How to read in xml header/version using python
Asked Answered
M

1

1

I'm looking for a way to read in the XML version header using the xml.sax parser in python.

**<?xml version="1.0"?>**
<root>
  <child>Hello</child>
  <child2>World</child>
</root>

So far, whenever I try to read in the XML, it just seems to skip over the header and go to the root node.

Any help would be greatly appreciated.

Thank you.

Manriquez answered 22/4, 2013 at 19:24 Comment(0)
F
0

I am not sure if this is available in your version of SAX, but the way to get it would be through the Locator2.

http://sax.sourceforge.net/apidoc/org/xml/sax/ext/Locator2.html

Flatto answered 22/4, 2013 at 19:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.