Dear Wiki user, You have subscribed to a wiki page or wiki category on "Xerces Wiki" for change notification.
The "XML_Schema_1.1_Assertions" page has been changed by assertions. http://wiki.apache.org/xerces/XML_Schema_1.1_Assertions?action=diff&rev1=104&rev2=105 -------------------------------------------------- ## page was renamed from assertions - ''Assertions'' is a new facility in XML Schema 1.1 language. It's officially described here, in the W3C spec, http://www.w3.org/TR/xmlschema11-1/#cAssertions. For an explanation of assertions feature and to know number of practical examples, please read the article [2] in "References" section below. + This page describes implementation details of [[http://www.w3.org/XML/Schema|XML Schema (XSD)]] 1.1 assertions feature, in [[http://xerces.apache.org/xerces2-j/|Xerces-J]] XML Schema processor. - This page describes implementation details of XML Schema 1.1 assertions feature, in [[http://xerces.apache.org/xerces2-j/|Xerces-J]] XML Schema processor. + ''Assertions'' is a new XML validation facility introduced in XSD 1.1 language. XSD 1.1 assertions allow us to constrain XML elements and attributes in useful ways, which results in a more effective XSD language. XSD Assertions are officially described here, in the W3C spec, http://www.w3.org/TR/xmlschema11-1/#cAssertions. For an explanation of assertions feature and to know number of practical examples, please read the article [2] in "References" section below. + '''Status of assertions development, in Xerces-J:'''<<BR>> + 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/). - '''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/). - 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 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. + + We're hoping to have a preview release for the community, of assertions implementation along with other XSD 1.1 facilities by the end of, 2009. + The user feedback would be helpful at this point. + '''XSD 1.1 assertions grammar notes (as defined in XSD 1.1 spec)''' - '''Assertions usage in Complex Types (as defined in the XML Schema 1.1 spec)''' + ''Assertions usage in Complex Types'': ''1. Complex Type Definition Schema Components'' @@ -73, +78 @@ </extension> - '''Assertions usage in Simple Types (as defined in the XML Schema 1.1 spec)''' + ''Assertions usage in Simple Types'': <simpleType final = (#all | List of (list | union | restriction | extension)) @@ -91, +96 @@ </restriction> - '''Design approach''' + '''Assertions design approach, within Xerces-J''' - 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. + 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. + Since "assertion" is now a new facet (a constraining facet) in XSD 1.1, for XML Schema Simple types, the current facet data structures, and the facet traverser (traverser is a mechanism used by Xerces to populate XSModel, from XSD syntax) are enhanced to support XML Schema 1.1 assertions. - To implement assertions for complex types, the complex type traverser of Xerces is modified. + To implement assertions for Complex types, the Complex type traverser of Xerces is modified. '''Assertions XPath 2.0 processing implementation''' @@ -116, +121 @@ 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, 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. 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 their own XPath 2.0 engine, using the XPath 2.0 engine's 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'''. + 1. Error codes, and descriptions: + Xerces-J flags error messages during assertions processing, as recommended by the XML Schema 1.1 specification. Here's the summary of error codes/messages, used by Xerces during assertion processing: + a. '''cvc-assertion.3.13.4.1''' -> Xerces uses this error code, with a description like following "test.xml:3:11:cvc-assertion.3.13.4.1: Assertion evaluation ('x = 'hello world'') for element 'Example' with type '#anonymous' did not succeed.", when any of the assertions evaluate to false. + a. '''cvc-assertion.4.3.15.3''' -> This error code is used, with a description like following "test.xml:2:15:cvc-assertion.4.3.15.3: Assertion evaluation ('. = 'hello'') for element 'x' with type '#anonymous' did not succeed (undefined context).", when an attempt is made to access the XPath context (for e.g, with the expression "."), during assertion facet evaluation. + a. '''cvc-xpath.3.13.4.2''' -> This error code is used, with a description like following "cvc-xpath.3.13.4.2: Assertion XPath expression, ('. === 'hello'') on the Schema type ('#AnonType_xExample') couldn't compile successfully.", when a syntactically wrong XPath expression, is provided for assertion evaluations. '''References:''' --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
