Home | Trees | Indices | Help |
|
---|
|
xml.sax.handler.ContentHandler --+ | object --+ | LIGOLWContentHandler --+ | FilteringLIGOLWContentHandler
LIGO LW content handler that loads everything but those parts of a document that match some criteria. Useful, for example, when one wishes to read everything except a single table from a file.
Example:
>>> from glue.ligolw import utils as ligolw_utils >>> def contenthandler(document): ... return FilteringLIGOLWContentHandler(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 with all the Table elements and their children removed.
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from Inherited from Inherited from |
|
|||
Inherited from |
|
Those elements for which element_filter(name, attrs) evaluates to False, and the children of those elements, will not 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 |