Package dataprocessor :: Package sax :: Module saxjcml2orange :: Class SaxJcmlOrangeContent
[hide private]
[frames] | no frames]

Class SaxJcmlOrangeContent

source code

xml.sax.handler.ContentHandler --+
                                 |
                                SaxJcmlOrangeContent

Instance Methods [hide private]
 
__init__(self, o_file, class_name, meta_attributes, compact_mode=False, filter_attributes={}, hidden_attributes=[], class_discretize=False) source code
 
set_tags(self)
Handles the basic tags used for reading the simple XML format.
source code
 
startElement(self, name, attrs)
Signals the start of an element (simplesentence or parallelsentence)
source code
 
characters(self, ch)
The Parser will call this method to report each chunk of character data.
source code
 
endElement(self, name)
Saves the data from an element that is currently ending.
source code

Inherited from xml.sax.handler.ContentHandler: endDocument, endElementNS, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startElementNS, startPrefixMapping

Method Details [hide private]

__init__(self, o_file, class_name, meta_attributes, compact_mode=False, filter_attributes={}, hidden_attributes=[], class_discretize=False)
(Constructor)

source code 
Parameters:
  • oFile (file object) - file object to receive processed changes
  • attributeNames (list of strings) - a list of attribute names
Overrides: xml.sax.handler.ContentHandler.__init__

set_tags(self)

source code 

Handles the basic tags used for reading the simple XML format. As tags are prone to changes, this can be done by changing values here, or overriding accordingly

startElement(self, name, attrs)

source code 

Signals the start of an element (simplesentence or parallelsentence)

Parameters:
  • name (string) - the name of the element
  • attrs (attributes) - of the element type as a string and the attrs parameter holds an object of the Attributes interface containing the attributes of the element.
Overrides: xml.sax.handler.ContentHandler.startElement

characters(self, ch)

source code 

The Parser will call this method to report each chunk of character data. We use it to store the string of the simplesentence

Parameters:
  • ch (str) - character being parsed
Overrides: xml.sax.handler.ContentHandler.characters

endElement(self, name)

source code 

Saves the data from an element that is currently ending.

Parameters:
  • name (string) - the name of the element
Overrides: xml.sax.handler.ContentHandler.endElement