MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / XML

Function XML

tools/python-3.11.9-amd64/Lib/xml/etree/ElementTree.py:1337–1351  ·  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

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