MCPcopy
hub / github.com/httpie/cli / parse_declaration

Function parse_declaration

httpie/output/formatters/xml.py:20–26  ·  view source on GitHub ↗
(raw_body: str)

Source from the content-addressed store, hash-verified

18
19
20def parse_declaration(raw_body: str) -> Optional[str]:
21 body = raw_body.strip()
22 # XMLDecl ::= '<?xml' DECL_CONTENT '?>'
23 if body.startswith(XML_DECLARATION_OPEN):
24 end = body.find(XML_DECLARATION_CLOSE)
25 if end != -1:
26 return body[:end + len(XML_DECLARATION_CLOSE)]
27
28
29def pretty_xml(document: 'Document',

Callers 2

pretty_xmlFunction · 0.85
format_bodyMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected