A test case for XML validation: a Cocoon sitemap J.M. Vanel jmvanel@remove-this.free.fr jeu jan 23 12:42:33 CET 2003 ABSTRACT I tried several XML Schema validators (XSV, Xerces, Microsoft) on a work-in-progress XML Schema for Cocoon sitemap. Some validators find some errors, some others find other errors, and I can not decide wether the Schema nor the document are correct. But you might find the journey interesting. I give all the recipies. This is work-in-progress, comments welcome. _____________________________________________________ I have a (corrected) XML Schema for Cocoon sitemap here: http://jmvanel.free.fr/cocoon/sitemap.xsd It has been taken from the CVS at apache.org: http://cvs.apache.org/viewcvs.cgi/*checkout*/xml-cocoon2/src/documentation/xdocs/drafts/sitemap-2.1-draft.xsd?rev=HEAD&content-type=text/plain I have a minimal Cocoon sitemap here: http://jmvanel.free.fr/cocoon/exemple1/sitemap.xmap I want to try XML Schema for my small Cocoon sitemap. After an obvious Schema error (an inner complexType having a name line 330), sitemap.xsd passes validation by XSV, the tool made by Henry Thompson, XML Schema editor. XSV can be used by a Web form at: http://www.w3.org/2001/03/webdata/xsv Xerces gives on sitemap.xsd about 10 error messages that maybe are not relevant. It didn't find the inner complexType having a name. But it also found an error that no other processor found: maxOccurs="0" (lines 205 and 206) (See ANNEXES for details on running Xerces). I don't know if it is formally erroneous, but it has no common sense to specify something to occur zero time, better nothing at all. _____________________________________________________ I continue the investigation with instance validation with XSV, the only one that aproves the corrected XML Schema for Cocoon sitemap (see below details about installing XSV on Linux). python $PYTHONPATH/XSV/commandLine.py sitemap.xmap ~/jmvanel.free.fr/cocoon/sitemap.xsd non-deterministic content model for type pipelineType: {http://apache.org/cocoon/sitemap/2.0}:select/{http://apache.org/cocoon/sitemap/2.0}:select non-deterministic content model for type matchType: {http://apache.org/cocoon/sitemap/2.0}:act/{http://apache.org/cocoon/sitemap/2.0}:act It appears that on instance validation messages about the Schema alone are produced. What does this mean ? It needs further investigation, but it seems that parallel choices for matchType lead to what is considered "non-deterministic content model" by XSV. The element "act" can appear in several parallel choices. It is possible that sitemap.xsd has to be completely rewriten. The sitemap.xsd on my site has a few corrections that are without doubt necessary, but nothing more. TO BE CONTINUED _____________________________________________________ ANNEXES http://www.gotdotnet.com/services/xsdvalidator/ GotDotNet XSD Schema Validator Schema document: NamespaceURI: XML document: Validation error: The content model must be deterministic. Multiple definition of element 'http://apache.org/cocoon/sitemap/2.0:match' causes content model to become ambiguous. An error occurred at (243, 6). The content model must be deterministic. Multiple definition of element 'http://apache.org/cocoon/sitemap/2.0:match' causes content model to become ambiguous. An error occurred at (315, 6). The content model must be deterministic. Multiple definition of element 'http://apache.org/cocoon/sitemap/2.0:call' causes content model to become ambiguous. An error occurred at (359, 6). The content model must be deterministic. Multiple definition of element 'http://apache.org/cocoon/sitemap/2.0:match' causes content model to become ambiguous. An error occurred at (173, 6). The content model must be deterministic. Multiple definition of element 'http://apache.org/cocoon/sitemap/2.0:match' causes content model to become ambiguous. An error occurred at (376, 6). The content model must be deterministic. Multiple definition of element 'http://apache.org/cocoon/sitemap/2.0:call' causes content model to become ambiguous. An error occurred at (187, 6). The content model must be deterministic. Multiple definition of element 'http://apache.org/cocoon/sitemap/2.0:match' causes content model to become ambiguous. An error occurred at (397, 6). The content model must be deterministic. Multiple definition of element 'http://apache.org/cocoon/sitemap/2.0:match' causes content model to become ambiguous. An error occurred at (427, 18). Invalid particle derivation by restriction. An error occurred at (201, 6). This page allows you to validate an XML documents against an W3C XML Schema (XSD) or an XML Data-Reduced (XDR) schema, verify the schemas are valid, or simply check the well-formedness of XML documents. Different actions are taken depends on the submitted information. _________________________________________________________________________ Xerces in command line: I hacked the sax.Counter sample shipped with Xerces to be able to validate against an external Schema (not in