[Generateds-discuss] Using parseLiteral()
Brought to you by:
dkuhlman
From: Pete F. <pe...@gm...> - 2022-05-06 10:17:25
|
My high level goal is to read an XML schema (XSD), expand its imports and extract the types. I can use XPath on my XML document to extract values as text. I'd like then to use XPath or similar on the XSD to correctly coerce the text values to their types. It looks as if parseLiteral() / exportLiteral() might do the trick. However I have not been able to use them. I've got the test data and this successfully pretty prints the XML. $ python3 -c "import people; people.parse('people.xml')" I've tried a number of things but they all are unable to resolve exportLiteral(). $ python3 -c "import people; people.parseLiteral('people.xml')" #from people import * import people as model_ rootObj = model_.rootClass( Traceback (most recent call last): File "<string>", line 1, in <module> File "[...]/people.py", line 3345, in parseLiteral rootObj.exportLiteral(sys.stdout, 0, name_=rootTag) AttributeError: 'people' object has no attribute 'exportLiteral' -- Pete Forman |