summaryrefslogtreecommitdiff
path: root/doc/overview_what.txt
blob: c99d2b978f3c6c484eb14debb6e30bfcd04ad85f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
What Is PyXB?
=============

PyXB is a pure `Python <http://www.python.org>`_ package that generates
Python code for classes that correspond to data structures defined by
`XMLSchema <http://www.w3.org/XML/Schema>`_.  In concept it is similar to
`JAXB <http://en.wikipedia.org/wiki/JAXB>`_ for Java and `CodeSynthesis XSD
<http://www.codesynthesis.com/products/xsd/>`_ for C++.

The major goals of PyXB are:

* Provide a generated Python interface that is "Pythonic", meaning similar
  to one that would have been hand-written:

  + Attributes and elements are Python fields (currently accessed through
    inspector/mutator methods), with name conflicts resolved in favor of
    elements
  + Elements with maxOccurs larger than 1 are stored as Python lists
  + Bindings for type extensions inherit from the binding for the base type
  + Enumeration constraints are exposed as class (constant) variables

* Support bi-directional conversion (DOM to Python and back)

* Allow easy customization of the generated bindings to provide
  functionality along with content

* Support all XMLSchema features that are in common use, including:

  + complex content models (nested all/choice/sequence)
  + cross-namespace dependencies
  + include and import directives
  + constraints on simple types

Secondary goals, some of which have been achieved in the current release, are
listed in :ref:`pyxb_vision`.

Examples of Supported Schema
----------------------------

PyXB comes with pre-defined *bundles* which aggregate related namespaces
into pre-generated bindings that allow you to use them without having to
generate and manage them yourself.  These bundles also demonstrate the
complexity of schema that PyXB is prepared to handle.  Not all namespaces
have been fully tested, but they are expected to function correctly.

WS-*
^^^^

The following namespaces are available in support of web service
development:

.. PYXB_ARCHIVE_PATH=/home/pab/pyxb/dev/pyxb/bundles/wssplat// pyxbdump \
   | grep wssplat \
   | tr '\011' ' ' \
   | sed -e 's@^\([^ ]*\) \([^ ]*\).*$@``\2`` ``\1``@g' \
   | tr ' ' '\011' \
   | expand -40 \
   | sort \
   > /tmp/x

=====================================   ==========================================================
Binding Module                          Namespace
=====================================   ==========================================================
``pyxb.bundles.wssplat.bpws``           ``http://schemas.xmlsoap.org/ws/2003/03/business-process/``
``pyxb.bundles.wssplat.ds``             ``http://www.w3.org/2000/09/xmldsig#``
``pyxb.bundles.wssplat.httpbind``       ``http://schemas.xmlsoap.org/wsdl/http/``
``pyxb.bundles.wssplat.mimebind``       ``http://schemas.xmlsoap.org/wsdl/mime/``
``pyxb.bundles.wssplat.soap11``         ``http://schemas.xmlsoap.org/soap/envelope/``
``pyxb.bundles.wssplat.soap12``         ``http://www.w3.org/2003/05/soap-envelope``
``pyxb.bundles.wssplat.soapbind11``     ``http://schemas.xmlsoap.org/wsdl/soap/``
``pyxb.bundles.wssplat.soapbind12``     ``http://schemas.xmlsoap.org/wsdl/soap12/``
``pyxb.bundles.wssplat.soapenc``        ``http://schemas.xmlsoap.org/soap/encoding/``
``pyxb.bundles.wssplat.whttp``          ``http://www.w3.org/ns/wsdl/http``
``pyxb.bundles.wssplat.wsa``            ``http://www.w3.org/2005/08/addressing``
``pyxb.bundles.wssplat.wsam``           ``http://www.w3.org/2007/02/addressing/metadata``
``pyxb.bundles.wssplat.wscoor``         ``http://docs.oasis-open.org/ws-tx/wscoor/2006/06``
``pyxb.bundles.wssplat.wsdl11``         ``http://schemas.xmlsoap.org/wsdl/``
``pyxb.bundles.wssplat.wsdl20``         ``http://www.w3.org/ns/wsdl``
``pyxb.bundles.wssplat.wsdli``          ``http://www.w3.org/ns/wsdl-instance``
``pyxb.bundles.wssplat.wsdlx``          ``http://www.w3.org/ns/wsdl-extensions``
``pyxb.bundles.wssplat.wsoap``          ``http://www.w3.org/ns/wsdl/soap``
``pyxb.bundles.wssplat.wsp200607``      ``http://www.w3.org/2006/07/ws-policy``
``pyxb.bundles.wssplat.wsp``            ``http://www.w3.org/ns/ws-policy``
``pyxb.bundles.wssplat.wsrm``           ``http://docs.oasis-open.org/ws-rx/wsrm/200702``
``pyxb.bundles.wssplat.wsse``           ``http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd``
``pyxb.bundles.wssplat.wsu``            ``http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd``
=====================================   ==========================================================

OpenGIS
^^^^^^^

The following namespaces are available in support of `Open Geospatial
Consortium <http://www.opengeospatial.org/standards>`_ Geographic
Information System processing.  Note that several of these namespaces are
"private" bindings generated because the OGC definitions include their own
schema.  The modules corresponding to these namespace uses begin with an
underscore, and should generally not be used in other contexts.

.. PYXB_ARCHIVE_PATH=/home/pab/pyxb/dev/pyxb/bundles/opengis// pyxbdump \
   | grep opengis \
   | tr '\011' ' ' \
   | sed -e 's@^\([^ ]*\) \([^ ]*\).*$@``\2`` ``\1``@g' \
   | tr ' ' '\011' \
   | expand -50 \
   | sort \
   > /tmp/x

================================================  ==========================================================
Binding Module                                    Namespace
================================================  ==========================================================
``pyxb.bundles.opengis._atom``                    ``http://www.w3.org/2005/Atom``
``pyxb.bundles.opengis._dc``                      ``http://purl.org/dc/elements/1.1/``
``pyxb.bundles.opengis._dct``                     ``http://purl.org/dc/terms/``
``pyxb.bundles.opengis._ogc``                     ``http://www.opengis.net/ogc``
``pyxb.bundles.opengis._smil20``                  ``http://www.w3.org/2001/SMIL20/``
``pyxb.bundles.opengis._smil20lang``              ``http://www.w3.org/2001/SMIL20/Language``
``pyxb.bundles.opengis.citygml.appearance``       ``http://www.opengis.net/citygml/appearance/1.0``
``pyxb.bundles.opengis.citygml.base``             ``http://www.opengis.net/citygml/1.0``
``pyxb.bundles.opengis.citygml.building``         ``http://www.opengis.net/citygml/building/1.0``
``pyxb.bundles.opengis.citygml.cityFurniture``    ``http://www.opengis.net/citygml/cityfurniture/1.0``
``pyxb.bundles.opengis.citygml.cityObjectGroup``  ``http://www.opengis.net/citygml/cityobjectgroup/1.0``
``pyxb.bundles.opengis.citygml.generics``         ``http://www.opengis.net/citygml/generics/1.0``
``pyxb.bundles.opengis.citygml.landUse``          ``http://www.opengis.net/citygml/landuse/1.0``
``pyxb.bundles.opengis.citygml.relief``           ``http://www.opengis.net/citygml/relief/1.0``
``pyxb.bundles.opengis.citygml.texturedSurface``  ``http://www.opengis.net/citygml/texturedsurface/1.0``
``pyxb.bundles.opengis.citygml.transportation``   ``http://www.opengis.net/citygml/transportation/1.0``
``pyxb.bundles.opengis.citygml.vegetation``       ``http://www.opengis.net/citygml/vegetation/1.0``
``pyxb.bundles.opengis.citygml.waterBody``        ``http://www.opengis.net/citygml/waterbody/1.0``
``pyxb.bundles.opengis.csw_2_0_2``                ``http://www.opengis.net/cat/csw/2.0.2``
``pyxb.bundles.opengis.filter``                   ``http://www.opengis.net/ogc``
``pyxb.bundles.opengis.gml_3_2``                  ``http://www.opengis.net/gml/3.2``
``pyxb.bundles.opengis.gml``                      ``http://www.opengis.net/gml``
``pyxb.bundles.opengis.gmlsf``                    ``http://www.opengis.net/gmlsf``
``pyxb.bundles.opengis.gmx``                      ``http://www.isotc211.org/2005/gmx``
``pyxb.bundles.opengis.ic_ism_2_1``               ``urn:us:gov:ic:ism:v2``
``pyxb.bundles.opengis.iso19139.gco``             ``http://www.isotc211.org/2005/gco``
``pyxb.bundles.opengis.iso19139.gmd``             ``http://www.isotc211.org/2005/gmd``
``pyxb.bundles.opengis.iso19139.gsr``             ``http://www.isotc211.org/2005/gsr``
``pyxb.bundles.opengis.iso19139.gss``             ``http://www.isotc211.org/2005/gss``
``pyxb.bundles.opengis.iso19139.gts``             ``http://www.isotc211.org/2005/gts``
``pyxb.bundles.opengis.misc.xAL``                 ``urn:oasis:names:tc:ciq:xsdschema:xAL:2.0``
``pyxb.bundles.opengis.misc.xlinks``              ``http://www.w3.org/1999/xlink``
``pyxb.bundles.opengis.ogckml22``                 ``http://www.opengis.net/kml/2.2``
``pyxb.bundles.opengis.om_1_0``                   ``http://www.opengis.net/om/1.0``
``pyxb.bundles.opengis.ows_1_1``                  ``http://www.opengis.net/ows/1.1``
``pyxb.bundles.opengis.ows``                      ``http://www.opengis.net/ows``
``pyxb.bundles.opengis.sampling_1_0``             ``http://www.opengis.net/sampling/1.0``
``pyxb.bundles.opengis.sensorML_1_0_1``           ``http://www.opengis.net/sensorML/1.0.1``
``pyxb.bundles.opengis.sos_1_0``                  ``http://www.opengis.net/sos/1.0``
``pyxb.bundles.opengis.swe_1_0_0``                ``http://www.opengis.net/swe/1.0``
``pyxb.bundles.opengis.swe_1_0_1``                ``http://www.opengis.net/swe/1.0.1``
``pyxb.bundles.opengis.tml``                      ``http://www.opengis.net/tml``
``pyxb.bundles.opengis.wcs_1_1``                  ``http://www.opengis.net/wcs/1.1``
``pyxb.bundles.opengis.wfs``                      ``http://www.opengis.net/wfs``
================================================  ==========================================================

Generating Bundled Bindings
^^^^^^^^^^^^^^^^^^^^^^^^^^^

Due to the size of the generated code, bundles are not incorporated into the
core distribution of PyXB.  To create the support infrastructure for a
particular bundle, run the ``scripts/genbind`` script in the bundle root.
For example::

  cd ${PYXB_ROOT}
  pyxb/bundles/wssplat/scripts/genbind

will invoke the :manpage:`wget(1)` program to retrieve the XML schema for a
variety of namespaces related to web services, and generate bindings and
archive files for them.