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
23
class SkipNode(XmlNode):
    """Utility node to skip parsing unknown properties."""

    __slots__ = "ns_map"

    def __init__(self):
        """Initialize the xml node."""
        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

__init__()

Initialize the xml node.

Source code in xsdata/formats/dataclass/parsers/nodes/skip.py
11
12
13
def __init__(self):
    """Initialize the xml node."""
    self.ns_map = {}

child(qname, attrs, ns_map, position)

Skip nodes children are skipped as well.

Source code in xsdata/formats/dataclass/parsers/nodes/skip.py
15
16
17
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
19
20
21
22
23
def bind(
    self, qname: str, text: Optional[str], tail: Optional[str], objects: list
) -> bool:
    """Skip nodes are not building any objects."""
    return False