Home | Trees | Indices | Help |
|
---|
|
xml.sax.handler.ContentHandler --+ | object --+ | LIGOLWContentHandler
ContentHandler class for parsing LIGO Light Weight documents with a SAX2-compliant parser.
Example:
>>> # initialize empty Document tree into which parsed XML tree >>> # will be inserted >>> xmldoc = Document() >>> # create handler instance attached to Document object >>> handler = LIGOLWContentHandler(xmldoc) >>> # open file and parse >>> make_parser(handler).parse(open("demo.xml")) >>> # write XML (default to stdout) >>> xmldoc.write()
NOTE: this example is for illustration only. Most users will wish to use the .load_*() functions in the glue.ligolw.utils subpackage to load documents, and the .write_*() functions to write documents. Those functions provide additional features such as support for gzip'ed documents, MD5 hash computation, and Condor eviction trapping to avoid writing broken documents to disk.
See also: PartialLIGOLWContentHandler, FilteringLIGOLWContentHandler.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from Inherited from |
|
|||
Inherited from |
|
Initialize the handler by pointing it to the Document object into which the parsed file will be loaded.
|
Receive notification of character data. The Parser will call this method to report each chunk of character data. SAX parsers may return all contiguous character data in a single chunk, or they may split it into several chunks; however, all of the characters in any single event must come from the same external entity so that the Locator provides useful information.
|
Signals the end of an element in namespace mode. The name parameter contains the name of the element type, just as with the startElementNS event.
|
Signals the start of an element in namespace mode. The name parameter contains the name of the element type as a (uri, localname) tuple, the qname parameter the raw XML 1.0 name used in the source document, and the attrs parameter holds an instance of the Attributes class containing the attributes of the element. The uri part of the name tuple is None for elements which have no namespace.
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Tue Dec 12 00:34:18 2017 | http://epydoc.sourceforge.net |