MCPcopy Index your code
hub / github.com/RustPython/RustPython / XML

Function XML

Lib/xml/etree/ElementTree.py:1339–1353  ·  view source on GitHub ↗

Parse XML document from string constant. This function can be used to embed "XML Literals" in Python code. *text* is a string containing XML data, *parser* is an optional parser instance, defaulting to the standard XMLParser. Returns an Element instance.

(text, parser=None)

Source from the content-addressed store, hash-verified

1337
1338
1339def XML(text, parser=None):
1340 """Parse XML document from string constant.
1341
1342 This function can be used to embed "XML Literals" in Python code.
1343
1344 *text* is a string containing XML data, *parser* is an
1345 optional parser instance, defaulting to the standard XMLParser.
1346
1347 Returns an Element instance.
1348
1349 """
1350 if not parser:
1351 parser = XMLParser(target=TreeBuilder())
1352 parser.feed(text)
1353 return parser.close()
1354
1355
1356def XMLID(text, parser=None):

Callers

nothing calls this directly

Calls 4

feedMethod · 0.95
closeMethod · 0.95
XMLParserClass · 0.85
TreeBuilderClass · 0.85

Tested by

no test coverage detected