Questions tagged [pyxb]

PyXB (“pixbee”) is a pure Python package that generates Python source code for classes that correspond to data structures defined by XMLSchema.

PyXB (“pixbee”) is a pure Python package that generates Python source code for classes that correspond to data structures defined by XMLSchema.

Docs: https://pabigot.github.io/pyxb/
Development repository: https://github.com/pabigot/pyxb

On Apr 11, 2018 the author announced End-Of-Life.

There is a little bit more update fork at https://github.com/jonfoster/pyxb. See also actively developing alternative generateDS.

56 questions
16
votes
1 answer

End-to-end example with PyXB. From an XSD schema to an XML document

I am having a hard time getting started with PyXB. Say I have an XSD file (an XML schema). I would like to: Use PyXB to define Python objects according to the schema. Save those objects to disk as XML files that satisfy the schema. How can I do…
Amelio Vazquez-Reina
  • 91,494
  • 132
  • 359
  • 564
3
votes
0 answers

PyXB get order of sub-elements of arbitrary element type definition

I'm working with multiple XSD class bindings using PyXB 1.2.6. I want to get the order of sub-element names of an arbitrary element type definition. So far I came up with this code: from pyxb.binding.basis import element def…
Richard Neumann
  • 2,986
  • 2
  • 25
  • 50
3
votes
1 answer

Is there any way to workaround import version conflict ion issue caused by Pyxb

I have 3 python projects. Project A, project B and project C. Project C depends on Porject A and B Project C --- depends ---> Project A Project C --- depends ---> Project B And project A and project B all depends on PyXB, they use some generated…
Fang-Pen Lin
  • 13,420
  • 15
  • 66
  • 96
3
votes
1 answer

Pyxb Instance of has no bound element for start tag

I used a schema file (.xsd) to generate python classes for generating xml-code. I can use all generated calsses but get an error if i try to print d.toxml("utf-8") File "/usr/local/lib/python2.7/dist-packages/pyxb/binding/basis.py", line 541, in…
k1ngarthur
  • 124
  • 1
  • 12
2
votes
0 answers

orderedContent PyXB return empty lists

I am trying to parse and XML file with simple and complex types using pyxb library. The following is the XML structure :
2
votes
1 answer

PyXB: generating class names in Unicode

Can somebody point me to the right direction as I'm unable to generate binding classes with PyXB when element names are non ASCII? The minimal reproducible example:
Sergey Bushmanov
  • 23,310
  • 7
  • 53
  • 72
2
votes
1 answer

Problems running pyxbgen

Running W10. Python3.2.3. Downloaded PyXB-1.2.4.tar.gz at a prompt ran "python setup.py install" Everything appears to be installed correctly. When I run pyxbgen I received file is not recognized... I search the drive only to find a file pyxbgen…
2
votes
2 answers

pyxb's decimal datatype loses zeros

I've noticed that the pyxb decimal datatype doesn't preserve trailing zeroes when it renders to XML. The culprit is a call to normalize() in the following line of the XsdLiteral function, in line 159 of binding/datatypes.py: (sign, digits, exponent)…
Eli Rose
  • 6,788
  • 8
  • 35
  • 55
2
votes
1 answer

PyXB add schema location

I wonder how I could get pyxb to add the schema location to generated xml, eg.
Dan Schien
  • 1,392
  • 1
  • 17
  • 29
1
vote
2 answers

Couldn't Run the .py file | AttributeError: module 'collections' has no attribute 'MutableSequence'

I am working with odx files and I have a generate.py file to run. I am using pyXB. When I try to run I am getting this. *Traceback (most recent call last): File…
R-K
  • 25
  • 1
  • 6
1
vote
0 answers

Including XHTML content when creating ReqIf XML document using pyXB

A bit of background: in the scope of a requirements management plugin for Sphinx, I'm looking into ways to export ReqIF XML content. I've found pyreqif, but found that it isn't complete enough to suit our needs at the moment. I decided to take a…
1
vote
2 answers

Very Strange XML Schema Issue

I'm trying to parse custom XML file formats with PyXB. So, I first wrote the following XML schema:
1
vote
1 answer

Importing two pyxb bindings with conflicting elements into the same namespace

I have several XSD files from which we have generated python bindings with pyxb (1.2.6). Each of these XSD files use the same namespace. Some of them define elements that have the same name (MyNamedElement). As a result, importing two of such…
BobMcFry
  • 21
  • 1
  • 4
1
vote
1 answer

How to install and use PyXB? 'pxbgen' is not recognized

I'm trying make sense of XML messages in Python with the use of PyXB. However, when I install PyXB, I'm getting an error when trying to use the pyxbgen command: "'pxbgen' is not recognized as an internal or external command, operable program or…
Sharkz
  • 345
  • 1
  • 2
  • 13
1
vote
1 answer

How to uninstall PyXB?

I've tried uninstalling PyXB from my PyCharm and also using the pip command line. I've tried: pip uninstall PyXB and I get the error msg. listed below: C:\Users\NTier> pip list Package Version --------------- --------- …
JDOaktown
  • 4,262
  • 7
  • 37
  • 52
1
2 3 4