summaryrefslogtreecommitdiff
path: root/doc/limitations.txt
blob: 6a523c70ce40bdbbaec553179191f5b5d3402e05 (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
Limitations
***********

Things That Work
----------------

* Class constants corresponding to string enumeration constraints

* Simple and complex type definitions

* List and union datatypes

* Constraints on (simple) datatypes (e.g., minInclusive, length)

* Model groups and attribute groups

* Complex content models (all, sequence, choice); minOccurs and maxOccurs

* Abstract types, `xsi:type <http://www.w3.org/TR/xmlschema-1/#xsi_type>`_,
  substitution groups

* Nillable elements with `xsi:nil <http://www.w3.org/TR/xmlschema-1/#xsi_nil>`_

* Namespace qualified attributes and elements

* Documentation annotations present in the schema are converted to Python
  docstrings in the generated bindings.



Things That Don't Work
----------------------

...but could someday
^^^^^^^^^^^^^^^^^^^^

* Pattern constraints don't do anything.

* The ability to use templates to customize binding generation was promised
  in the vision document.  That has not yet been done, though it should be
  fairly straightforward.

...and probably never will
^^^^^^^^^^^^^^^^^^^^^^^^^^

* When generating a DOM instance from a binding instance, the resulting
  document should validate against the schema, but the order of elements
  within it may be different from the original order of creation.  For an
  example of this, see
  :file:`tests/test-mg-choice:TestMGChoice.testMultichoiceOrderImportant`.
  See also
  :api:`pyxb.binding.basis.complexTypeDefinition._validatedChildren` for a
  work-around.

* The redefine directive is not supported.

* Identity constraints ("key", "unique", "keyref") are stored in the content
  model, but are not used.

* `Wildcard elements <http://www.w3.org/TR/xmlschema-1/#Wildcards>`_ are
  supported in the sense that classes that enable them in the content model
  provide access to unrecognized values through the
  :api:`pyxb.binding.basis.complexTypeDefinition.wildcardElements` method.
  Where the type of the node is recognized, it is converted to a Python
  binding instance.  However, neither the namespace constraint nor process
  contents attributes are applied.

* `Wildcard attributes
  <http://www.w3.org/TR/xmlschema-1/#ag-attribute_wildcard>`_ are supported
  in the same sense as wildcard elements: no constraints are checked, and
  all are aggregated into the
  :api:`pyxb.binding.basis.complexTypeDefinition.wildcardAttributeMap`.

Things That Mostly Work, But They're Ugly
-----------------------------------------

* The `duration <http://www.w3.org/TR/xmlschema-2/#duration>`_ type is based
  on the Python ``datetime.timedelta`` class, which works reasonably well
  for small deltas but does not handle month and year deltas.  The PyXB
  version records that information, but the ``timedelta`` functionality
  (adding/substracting from ``datetime`` instances) does not incorporate
  that portion of the delta.  Negative durations also may not work properly.


Intended Near-Term Enhancements
-------------------------------

* Any requests?