Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/ActiveState/code
/ prettify
Function
prettify
recipes/Python/579019_Python_AST_to_XML/recipe-579019.py:21–23 ·
view source on GitHub ↗
(xml_string)
Source
from the content-addressed store, hash-verified
19
from
xml.etree
import
ElementTree
as
etree
20
21
def
prettify(xml_string):
22
reparsed = minidom.parseString(xml_string)
23
return
reparsed.toprettyxml(indent=
" "
)
24
25
class
ast2xml(ast.NodeVisitor):
26
def
__init__(self):
Callers
1
main
Function · 0.70
Calls
1
parseString
Method · 0.80
Tested by
no test coverage detected