Skip to content

skip

xsdata.formats.dataclass.parsers.nodes.skip

SkipNode

Bases: XmlNode

Utility node to skip parsing unknown properties.

Source code in xsdata/formats/dataclass/parsers/nodes/skip.py
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
class SkipNode(XmlNode):
    """Utility node to skip parsing unknown properties."""

    __slots__ = "ns_map"

    def __init__(self):
        self.ns_map = {}

    def child(self, qname: str, attrs: Dict, ns_map: Dict, position: int) -> XmlNode:
        """Skip nodes children are skipped as well."""
        return self

    def bind(
        self, qname: str, text: Optional[str], tail: Optional[str], objects: List
    ) -> bool:
        """Skip nodes are not building any objects."""
        return False

child(qname, attrs, ns_map, position)

Skip nodes children are skipped as well.

Source code in xsdata/formats/dataclass/parsers/nodes/skip.py
14
15
16
def child(self, qname: str, attrs: Dict, ns_map: Dict, position: int) -> XmlNode:
    """Skip nodes children are skipped as well."""
    return self

bind(qname, text, tail, objects)

Skip nodes are not building any objects.

Source code in xsdata/formats/dataclass/parsers/nodes/skip.py
18
19
20
21
22
def bind(
    self, qname: str, text: Optional[str], tail: Optional[str], objects: List
) -> bool:
    """Skip nodes are not building any objects."""
    return False