Python XML Schema Bindings
Branch: next
Clone or download
pabigot generate: replace incorrect use of default with fallback
Commit 68ca552 introduced an error in
nomenclature by confusing the concept of a default namespace with the
concept of a fallback namespace.  The two are not at all the same thing.

A fallback namespace is used to associate an element or attribute
identified by an expanded name that has no namespace name with the
information set from a schema that had no target namespace.  The feature
exists because there is no other way to perform that association.

A default namespace is used to provide a default namespace name if there
is no namespace prefix on the tag.  In valid XML this is specified
through an `xmlns=uri` attribute in a start tag.

To this point PyXB has not accepted as valid any XML where the root
element was in a non-absent namespace that was not explicitly
identified.  PyXB depends on the XML parser to determine the namespace
name of an expanded name.  It is only when that name is absent (and so
could not have been provided by valid XML) that PyXB will associate the
corresponding information set from a contextually-specified absent
Namespace.  It is outside PyXB's scope to override namespaces in a
situation where valid XML requires a namespace name and the parser fails
to provide one.  Since xml.sax does not appear to provide a mechanism to
assign an initial default namespace that is not present in the XML text
there is no way to support the use case in issue #94 within PyXB.

This commit makes no intentional behavioral change, but to reduce future
confusion it changes the canonical keyword and positional argument to be
`fallback_namespace`.  It adds a temporary workaround to accept
`default_namespace` as a deprecated alias in case somebody's depending
on the existing behavior.

Closes #94.
Latest commit 14737c2 Feb 11, 2018


PyXB -- Python W3C XML Schema Bindings
Version 1.2.7-DEV

The source releases includes pre-built bundles for common XML namespaces,
assorted web service namespaces, and SAML.  A bundle with over 75 namespaces
related to Geographic Information Systems is also available; if you want
those, read pyxb/bundles/opengis/README.txt before installing PyXB.

Installation:  python install

Documentation: doc/html or

Help Forum:

Mailing list:

Bug reports: