Dear Wiki user, You have subscribed to a wiki page or wiki category on "Xerces Wiki" for change notification.
The following page has been changed by assertions: http://wiki.apache.org/xerces/XML_Schema_1%2e1_Assertions ------------------------------------------------------------------------------ '''Status of assertions development:''' The assertions implementation in Xerces-J is complete, and Xerces team has checked in the code for this, at the SVN repository (https://svn.apache.org/repos/asf/xerces/java/branches/xml-schema-1.1-dev/). - Though, the current assertions implementation in Xerces-J solves most of the XML Schema 1.1 assertions use cases, the implementation is technically not 100% compliant to the XML Schema 1.1 assertions specification at the moment. The assertions features, which still need to be implemented are: The '''id''' and '''xpathDefaultNamespace''' attributes on '''xs:assert''' instruction. The work for this is underway.[[BR]] + The only assertions feature which still needs to be implemented and tested is, the '''id''' attribute on '''xs:assert''' and '''xs:assertion''' instructions. The work for this is underway.[[BR]] The user feedback would be helpful at this point. @@ -93, +93 @@ '''Design approach''' - The Xerces XSModel is modified to handle assertions, for the XML Schema 1.1 simple and complex types. + The Xerces XSModel (an object model representing an XML Schema) is modified to handle assertions, for the XML Schema 1.1 "simple" and "complex" types. Since 'assertion' is now a new facet for XML Schema simple types, the current facet data structures, and the facet traverser are enhanced to support XML Schema 1.1 assertions. @@ -102, +102 @@ '''Assertions XPath 2.0 processing implementation''' - We are designing a Java interface API for integrating Xerces with an XPath 2.0 engine. It should be possible to plug in any compliant XPath 2.0 engine to the Xerces assertions processor, by writing a small Java layer complying to this interface. + Xerces provides a Java interface API, for integrating Xerces with XPath 2.0 evaluation engines. It should be possible to plug in any compliant XPath 2.0 engine to the Xerces assertions processor, by writing a small Java layer complying to this interface. + Xerces provides a sample implementation of this interface for [http://www.eclipse.org/webtools/ Eclipse XPath2/PsychoPath] XPath 2.0 engine. This should be very good enough, for open source Xerces-J product. - A first version of this interface is complete, and we have written sample implementations of this interface for following freely available XPath 2.0 engines: - - 1. [http://www.eclipse.org/webtools/ Eclipse XPath2/PsychoPath] - 1. [http://saxon.sourceforge.net/ Saxon basic] - We have tried our best, to write an efficient implementation of XPath 2.0 integration for assertions. For nested elements having assertions, the child/descendant elements share the XPath (XDM) tree with the top most element. For each distinct XDM tree involved in assertions processing, we keep a reference of it's root node, and discard these references when assertions evaluation is complete for that tree. - A caution for Schema authors: If we are specifying assertions for the root element of the XML document, a tree will be built for assertions processing, which could be as large as the XML document. Where memory is a concern for large XML documents, assertions may be specified at an inner level [1] of the XML documents, as far as possible. This [1] will cause smaller trees to be built, thereby reducing memory footprint. + A caution for Schema authors: If we are specifying assertions for the root element of the XML document, a tree will be built for assertions processing, which could be as large as the XML document. Where memory is a concern for large XML documents, assertions may be specified at an inner level [1] of the XML documents, as far as possible. This [1] will cause smaller assertion trees to be built, thereby reducing memory footprint of the XML application. + It is also worth knowing, that assertions trees are smaller than corresponding generic XML infoset trees, because assertions trees only contain element and attribute information, along with certain XML Schema type annotations, whereas generic XML trees contain other information like processing instructions, comments and so on. '''Run-time notes''' - 1. By default, the Xerces-J Schema processor would select the PsychoPath engine for XPath 2.0 processing. Xerces-J has a provision for the user, to select between different XPath 2.0 engines for evaluating assertions. This can be done by setting the Java system property, '''org.apache.xerces.assertProcessor'''. Xerces-J has an out of the box support for PsychoPath and Saxon-b XPath 2.0 engines. If the user doesn't set this property, or set it's value to, '''org.apache.xerces.impl.xs.XMLAssertPsychopathImpl''', the PsychoPath processor would be selected for XPath 2.0 processing. For selecting Saxon-b as the XPath 2.0 engine, the user needs to set the value of this property to, '''org.apache.xerces.impl.xs.XMLAssertSaxonImpl'''. + 1. By default, the Xerces-J Schema processor would select the Eclipse/PsychoPath engine for XPath 2.0 processing. Xerces-J has a provision for the user, to select between different XPath 2.0 engines for evaluating assertions. This can be done by setting the Java system property, '''org.apache.xerces.assertProcessor'''. Xerces-J has an out of the box support for PsychoPath XPath 2.0 engine. If the user doesn't set this property, or set it's value to, '''org.apache.xerces.impl.xs.XMLAssertPsychopathImpl''', the PsychoPath processor would be selected for XPath 2.0 processing. - 1. If user's wish to use an XPath 2.0 engine other than PsychoPath or Saxon, for working with Xerces-J assertions, they need to write a custom Java layer similar to org.apache.xerces.impl.xs.XMLAssertPsychopathImpl or org.apache.xerces.impl.xs.XMLAssertSaxonImpl. Xerces-J would publish an API, to integrate to any available standard compliant XPath 2.0 engines. + 1. If user's wish to use an XPath 2.0 engine other than PsychoPath, for working with Xerces-J assertions, they need to write a custom Java layer similar to org.apache.xerces.impl.xs.XMLAssertPsychopathImpl, and integrate it with the other XPath 2.0 engine, using the XPath 2.0 engine's public APIs. Xerces-J would publish an API, to integrate to any available standard compliant XPath 2.0 engines. 1. Xerces-J flags error messages during assertions processing, as recommended by the XML Schema 1.1 specification. If the user provides a syntactically wrong XPath 2.0 expression, the Schema processing terminates, flagging an error message to the user with key, '''cvc-xpath.3.13.4.2'''. If the XPath 2.0 syntax is correct, but any of the assertions evaluate to "false", the Schema processing terminates, and an error message is shown to the user with key, '''cvc-assertion.3.13.4.1'''. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
