|
LibInsult - Python
|
Parses strings with flat xml elements intermixed with text Only a very minimal subset of xml/sgml is supported. More...
Public Member Functions | |
| def | __init__ (self, contents=None, to_string=lambda x:"") |
| def | element_by_id (self, id) |
| Returns the element matching the given id. More... | |
| def | elements_by_tag_name (self, name) |
| Returns a list of elements with the given tag name. More... | |
| def | elements_by_attribute (self, name, value) |
| Returns a list of elements having the given attribute with the given value. More... | |
| def | __str__ (self) |
| Converts the document to a string (using self.to_string for elements) More... | |
| def | __repr__ (self) |
| def | parse_string (self, string) |
| Parses a string into self.contents. More... | |
Public Attributes | |
| contents | |
| List mixing strings and NotQuiteXmlElement elements. More... | |
| elements_with_id | |
| Elements with an ID. More... | |
| to_string | |
| Functor to convert NotQuiteXmlElement objects to a string. More... | |
Parses strings with flat xml elements intermixed with text Only a very minimal subset of xml/sgml is supported.
| def insult.NotQuiteXml.__init__ | ( | self, | |
contents = None, |
|||
to_string = lambda x: "" |
|||
| ) |
| contents | None or a sting to be parsed |
| to_string | A functor to convert NotQuiteXmlElement objects to a string |
| def insult.NotQuiteXml.__str__ | ( | self | ) |
| def insult.NotQuiteXml.element_by_id | ( | self, | |
| id | |||
| ) |
| def insult.NotQuiteXml.elements_by_attribute | ( | self, | |
| name, | |||
| value | |||
| ) |
| def insult.NotQuiteXml.elements_by_tag_name | ( | self, | |
| name | |||
| ) |
| def insult.NotQuiteXml.parse_string | ( | self, | |
| string | |||
| ) |
| insult.NotQuiteXml.contents |
List mixing strings and NotQuiteXmlElement elements.
Definition at line 277 of file insult.py.
Referenced by insult.NotQuiteXml.__repr__(), insult.NotQuiteXml.__str__(), insult.NotQuiteXml.elements_by_attribute(), insult.NotQuiteXml.elements_by_tag_name(), and insult.NotQuiteXml.parse_string().
| insult.NotQuiteXml.elements_with_id |
Elements with an ID.
Definition at line 279 of file insult.py.
Referenced by insult.NotQuiteXml.element_by_id(), and insult.NotQuiteXml.parse_string().
| insult.NotQuiteXml.to_string |
Functor to convert NotQuiteXmlElement objects to a string.
1.8.11