Home | Trees | Indices | Help |
|
---|
|
xml.sax.handler.ContentHandler --+ | object --+ | LIGOLWContentHandler --+ | PartialLIGOLWContentHandler
LIGO LW content handler object that loads only those parts of the document matching some criteria. Useful, for example, when one wishes to read only a single table from a file.
Example:
>>> from glue.ligolw import utils as ligolw_utils >>> def contenthandler(document): ... return PartialLIGOLWContentHandler(document, lambda name, attrs: name == Table.tagName) ... >>> xmldoc = ligolw_utils.load_filename("demo.xml", contenthandler = contenthandler)
This parses "demo.xml" and returns an XML tree containing only the Table elements and their children.
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from Inherited from Inherited from |
|
|||
Inherited from |
|
Only those elements for which element_filter(name, attrs) evaluates to True, and the children of those elements, 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 |