Maps the attribute of an XML element to a simple Python object.
Note that names containing dot will see those replaced by underscores.
| Parameters: |
|
|---|
Maps an XML element to a Python object.
If parent is not None, self will be added to the parent.xml_children list.
If Element.as_list is set and if (name, namespace) belongs to it then we will add a list to parent with the name of the element
If Element.as_attribute is set and if (name, namespace) belongs to it then we will add an attribute to parent with the name of the element
| Parameters: |
|
|---|
Applies a filter to this element. Returns what is returned from some_filter.
| Parameters: |
|
|---|
Returns the child element named ‘name’, None if not found.
| Parameters: | -name: local name of the element - ns: namespace of the element |
|---|
Yields all children of this element named ‘name’
| Parameters: |
|
|---|
Returns a list of children belonging only to the types passed in types which must be a list or None. If None is passed then returns self.xml_children.
>>> feed.get_children_with(types=[Element])
This will return all the children which are of type bridge.Element
Returns a list of children not belonging to the types passed in types which must be a list or None. If None is passed then returns self.xml_children.
>>> feed.get_children_without(types=[str, Comment])
This will return all the children which are not of type string or bridge.Comment.
Checks if this element has a child named ‘name’ in its children elements
| Parameters: |
|
|---|
Insert element right after after_element. This only inserts the new element in self.xml_children.
| Parameters: |
|
|---|
Inserts element right before before_element. This only inserts the new element in self.xml_children.
| Parameters: |
|
|---|
Load source into an Element instance
| Parameters: |
|
|---|
Replaces the current element with a new element in the list of children.
| Parameters: |
|
|---|
Sets the attribute value. If the attribute does not exist it is created and set with name`and `value.
Returns the set attribute instance.
Updates prefixes of all the element of document matching (src, srcns)
| Parameters: |
|
|---|
Serializes this element as a string.
| Parameters: |
|
|---|---|
| Returns: | The XML string representing the current element. |
Represents a XML processing instruction.
| Parameters: |
|
|---|
Represents a XML comment
| Parameters: |
|
|---|