&XercesCName; includes an implementation of the W3C XML Schema
specification, a recommendation of the Worldwide Web Consortium
available in three parts:
minOccurs
or maxOccurs
attributes may result in poor performance and/or large amount
of memory being allocated by the parser. In such situations large values for
minOccurs
should be avoided, and unbounded
should be used instead.We have interpreted the specs as requiring <keyref> Identity Constraints to refer to <key> or <unique> identity constraints within the scope of the elements to which the <keyref> is attached. This interpretation is at variance with the Schema Primer, which contains an example with a <keyref> declared on an element used inside the element of its corresponding <key>.
For float data, the specification does not explicitly prescribe how to deal with out-of-bound data. &XercesCName; converts these values as shown below:
Values in range | Values converted |
less than -224 * 2104 (approx -3.402823669e+38) | -INF |
greater than -1 * 2-149 (approx -1.401298464e-45) and less than -0 | -0 |
greater than +0 and less than +1 * 2-149 (approx +1.401298464e-45) | +0 |
greater than +224 * 2104 (approx 3.402823669e+38) | +INF |
The effect of this conversion would invalidate an instance data, for example, "1.1e-46", of a data type derived from float, with minExclusive value '+0', since "1.1e-46" is converted to "+0", which is the same as the minExclusive.
Similarly, &XercesCName; converts double values as shown below (the values depend on the system specific values of DBL_MAX and DBL_MIN):
Values in range | Values converted |
less than -DBL_MAX (approx -1.7976931348623158e+308) | -INF |
greater than -DBL_MIN (approx -2.2250738585072014e-308) and less than -0 | -0 |
greater than +0 and less than +DBL_MIN (approx +2.2250738585072014e-308) | +0 |
greater than +DBL_MAX (approx +1.7976931348623158e+308) | +INF |
Below is an example that shows how to turn on schema processing in DOMParser (default is off). Note that you must also turn on namespace support (default is off) for schema processing.
Usage in SAXParser is similar, please refer to the SAXCount sample program for further reference.
Below is an example that shows how to turn on schema processing in SAX2XMLReader (default is on). Note that namespace must be on (default is on) as well.
Schema grammars can be associated with instance documents in three ways.
If schema grammar was not specified externally through methods, then each instance document that uses XML Schema grammars must specify the location of the grammars it uses by using an xsi:schemaLocation attribute if they use namespaces, and xsi:noNamespaceSchemaLocation attribute otherwise.
Here is an example with no target namespace:
Here is an example with a target namespace. Note that it is an error to specify a different namespace in xsi:schemaLocation attribute than the target namespace defined in the Schema.
An application developer may associate schemas with instance documents through
methods setExternalSchemaLocation
if they use namespaces, and
setExternalNoNamespaceSchemaLocation
otherwise.
(For SAX2XMLReader, use the properties:
"http://apache.org/xml/properties/schema/external-schemaLocation" and
"http://apache.org/xml/properties/schema/external-noNamespaceSchemaLocation")
Here is an example with no target namespace:
Here is an example with a target namespace. Note that it is an error to specify a
different namespace in setExternalSchemaLocation
than the target
namespace defined in the Schema.
An application developer may also pre-parse and
cache the grammar corresponding to the XML document
namespace as described in the