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
0
votes
1 answer

PyXB kml and gx extensions

I am trying to create bindings using the kml schema http://schemas.opengis.net/kml/2.2.0/ogckml22.xsd and the gx extension schema https://developers.google.com/kml/schema/kml22gx.xsd I have no trouble generating and using the bindings generated from…
0
votes
1 answer

PyXB : Creating More Rigid Instances of Anonymous Types

Is it possible to use PyXB to generate a module from an XSD that has anonymous complex types that can have some basic type- and constraints-checking ? Here's what I've managed so far: Using a 3rd-Party (Anonymised) XSD:
LRE
  • 956
  • 1
  • 10
  • 15
0
votes
1 answer

PYXB: Ignore missing attribute

I am parsing some XML using Pyxb and a required attribute is not available in the XML. I catch the MissingAttributeError exception which tells me: Instance of lacks required attribute how My question is, even…
0
votes
2 answers

XSD parsing documents and elements

I have a xsd for which I used pyxb to generate object classes for. So far everything is working, i'm able to take in documents, error handling, etc. is working fine. My only question is this, I have the following in my xsd:
KVISH
  • 12,923
  • 17
  • 86
  • 162
0
votes
1 answer

PyXB - AssertionError: No element bindings in http://www.w3.org/1999/xhtml

I am attempting to generate bindings for a WSDL with PyXB, and it is giving the AssertionError exception in the title. My understanding, based on the PyXB documentation, is that the bundle archive for http://www.w3.org/1999/xhtml is included with…
user3575460
  • 3
  • 1
  • 1
0
votes
1 answer

Parsing XML using PYXB. Can't get to nested anonymous elements

I've created Python bindings using PYXB(pyxbgen) on the following xsd files using the commands: pyxbgen -u Event.xsd -m Event pyxbgen -u Shape.xsd -m Shape pyxbgen -u flow-tags.xsd -m flow-tags Using the generated bindings, I can access all the…
0
votes
2 answers

What is the correct error class to be used to capture all exceptions for CreateFromDocument in pyxb

How to capture all possible pyxb exceptions for CreateFromDocument(input_xml). Example: try: py_obj = CreateFromDocument(input_xml) except pyxb.UnrecognizedContentError as e: raise e Here it captures only UnrecognizedContentError. But I…
0
votes
1 answer

How to make a binding instance in lxml?

I've been using PyXB to generate bindings for xml flows using its parser, which works, but the parser is giving gives me performance issues. I would therefore would like to try and use lxml instead with my limited experience. How can I make my…
Perry
  • 1,709
  • 1
  • 17
  • 25
0
votes
1 answer

Example with PyXB: Generate Python code and obtain Attribute value within XML Element

I am having a hard time getting started with PyXB. Let's use this XML file for example: Alice Smith 123 Maple Street
James the Great
  • 941
  • 2
  • 14
  • 46
0
votes
1 answer

pyxb UnrecognizedDOMRootNodeError

i've got the following xml schema:
k1ngarthur
  • 124
  • 1
  • 12
-4
votes
1 answer

PYXB - Generation of namespace groups requires generate-to-files

PYXB - When generating class definitions at runtime, iam facing following expection import pyxb.binding.generate path = "E:/schema/schema.xsd" code = pyxb.binding.generate.GeneratePython(schema_location=path) rv = compile(code, 'test', 'exec') xsd…
1 2 3
4