Questions tagged [python-generateds]

Use for questions about the generateDS Python module used for creating Python classes from XML Schema document.

generateDS generates Python data structures (for example, class definitions) from an XML Schema document. These data structures represent the elements in an XML document described by the XML Schema (e.g. classes are created for the type definitions in the XML Schema using name of the type for the class name). It also generates parsers that load an XML document into those data structures. If you have a basic understanding of the structure of the XML you want to generate, then generateDS is easy to create and parse valid XML documents.

Running generateDS

python generateDS.py -o people.py people.xsd

This generates a python module people.py with the classes to parse and create XML instance documents conforming to the people.xsd XML schema.

Asking Questions:

Useful Canonicals:

11 questions
4
votes
2 answers

How to correctly use GenerateDS for DDEX XML binding

I am interested in Python XML binding for reading input files conforming to this schema: http://ddex.net/xml/ern/341/release-notification.xsd This XSD depends on a number of other ones though, most importantly: http://ddex.net/xml/20120404/ddexC.xsd…
SpongeBob
  • 145
  • 8
2
votes
1 answer

How to fix generateDS error: "Can't find file TObject.xsd referenced in <_io.BufferedReader name='some_name.xsd'>."

I am using generateDS (http://www.davekuhlman.org/generateDS.html) to create python classes by some XSD, to create different XML files with python then. It works properly with some simple XSD files, but when I try the one I need, it gives me an…
1
vote
1 answer

Generating XML Request through xsd using generateDS

I would like to a) generate XML Requests b) and Parse Responses based on a schema(.xsd) i have from one of the OEM. I researched on net and generateDS seemed to be the one i was looking for however i am struggling to make it work. I was able to…
1
vote
1 answer

Validate Python classes created from generateDS

I have several XSDs that change sometimes. I used to write my XML files hard-coded, so every time that the XSD was changed, I had to search for the XML files that were dependent on that XSD. That's why I moved to generateDS (Version 2.15b). I wrote…
McMendel
  • 105
  • 11
0
votes
0 answers

Include XML declaration while genrating XML File using schama classes - generateDS Python

I am trying to generate a xml file in python using the scham class generated using "generateDS" module, but when the xml file is generated it does not include the xml declaration in it. can anyonne help me with this This is what I am…
0
votes
0 answers

Parse an xml with Generateds and external references

The xml is VALID, the error I get is when I try to parse the xml with the classes generated with Generateds. So, I´m generating classes for an xsd that has external xmlns. I generate the classes this way: python generateDS.py -o cc.py…
0
votes
2 answers

How to parse xsd and create XML's from it with python?

I'm very begginer with python and I have task to parse xsd schema to python code, fill nodes with values and create final XML file from it. Is it possible with generateDS tool? I can't find clear anwser in documentation. Maybe theres another way to…
wolfek
  • 3
  • 3
0
votes
1 answer

How to serialize initialized object in Python into XML?

I am pretty new to python. I now how to marshall/unmarshall objects in Java. I am looking for something like we did it in Java. Like: JAXBContext jaxbContext = JAXBContext.newInstance(com.Request1.class); Unmarshaller unmarshaller =…
0
votes
0 answers

How does self work in Object Oriented Programming in Python?

I'm working on generating a sample XML out of a subset of XSD schema file. I have generated data objects using GenerateDS. I instantiated the parent object and I'm using recursion with reflection to fill in all the children objects so I can write…
simnit
  • 1
  • 1
0
votes
2 answers

generateDS stops processing child elements

I have an xml schema that describes e-invoice structure. I've used schema with generateDS to create a parser for that format. When parsing an invoice, it seems to work fine, but a section where is any-typed content, it stops processing childs where…
Juha Tuomala
  • 111
  • 11
0
votes
1 answer

What version of generateDS is to be used for Python 3.0.0?

I have created Python classes by an XML schema file using generateDS2.12a. I am using these classes to create XML files. My module works well with a Python 2.7 environment. Now, due to some reason my environment is changed to Python 3.0.0. Now when…
Manu
  • 67
  • 2
  • 3
  • 8