INNER CODE UNIT · Python

makeExampleXML

KATRIN-Experiment/Kassiopeia · Scripts/gen-bindings-docs.py:137

    def makeExampleXML(self, level=0, stack=[], key='', max_children=999, max_attributes=999, include_root=True):
        spaces = '    '
        if not key and self.xml_names:
            key = list(self.xml_names)[0]

        if not self.xml_names:
            if include_root:
                for node_key in list(sorted(self.children.keys()))[:max_children]:
                    node = self.children[node_key]
                    if not node.name in stack:
                        node.makeExampleXML(level, stack, max_children=max_children, max_attributes=max_attributes)
            return

        indent = level*spaces

        if not self.children and not self.attributes:
           print(f'{indent}<{key}/>')
           return

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…