From: Ron V. d. B. <ron...@ka...> - 2007-09-07 08:11:05
|
Hi, Dannes Wessels schreef: > it is documented (wiki) that validation is limited using xsds/dtds > only. with the xquery functrions only the following is possible: > > Yes, the successful validation results against RelaxNG grammars confused me as well. On closer investigation I discovered that I was mislead by the validation cache. Once a .xsd grammar has been cached, it appears to be used until the validation cache is emptied again. What I called 'choking' in this thread's subject really is 'validation cache filling'. I still found the same output of steps 2 and 3 when executing the following query twice: let $a := <TEI xmlns="http://www.tei-c.org/ns/1.0"><teiHeader>test</teiHeader> </TEI> let $b := '/db/test/teilite.xsd' return validation:validate-report($a, xs:anyURI($b)) * results from first run: <report> <status>invalid</status> <time>516</time> <message level="Error" line="1" column="240">src-import.3.1: The namespace attribute, 'http://www.w3.org/XML/1998/namespace', of an <import> element information item must be identical to the targetNamespace attribute, 'http://www.tei-c.org/ns/1.0', of the imported document.</message> <message level="Error" line="477" column="55">src-resolve: Cannot resolve the name 'xml:space' to a(n) 'attribute declaration' component.</message> <message level="Error" line="477" column="55">s4s-elt-must-match.1: The content of 'att.global.attribute.xmlspace' must match (annotation?, ((attribute | attributeGroup)*, anyAttribute?)). A problem was found starting at: attribute.</message> <message level="Error" line="480" column="52">s4s-elt-must-match.1: The content of 'att.global.attribute.xmlid' must match (annotation?, ((attribute | attributeGroup)*, anyAttribute?)). A problem was found starting at: attribute.</message> <message level="Error" line="499" column="54">s4s-elt-must-match.1: The content of 'att.global.attribute.xmllang' must match (annotation?, ((attribute | attributeGroup)*, anyAttribute?)). A problem was found starting at: attribute.</message> <message level="Error" line="518" column="54">s4s-elt-must-match.1: The content of 'att.global.attribute.xmlbase' must match (annotation?, ((attribute | attributeGroup)*, anyAttribute?)). A problem was found starting at: attribute.</message> <message level="Error" line="1018" column="85">s4s-att-not-allowed: Attribute 'nillable' cannot appear in element 'element'.</message> [lates error repeated for 238 more lines ...] <message level="Error" line="1" column="69">cvc-complex-type.2.3: Element 'teiHeader' cannot have character [children], because the type's content type is element-only.</message> <message level="Error" line="1" column="69">cvc-complex-type.2.4.b: The content of element 'teiHeader' is not complete. One of '{"http://www.tei-c.org/ns/1.0":fileDesc}' is expected.</message> <message level="Error" line="1" column="75">cvc-complex-type.2.4.b: The content of element 'TEI' is not complete. One of '{"http://www.tei-c.org/ns/1.0":text}' is expected.</message> </report> * results from subsequent runs (as long as validation cache is filled): <report> <status>invalid</status> <time>15</time> <message level="Error" line="1" column="69">cvc-complex-type.2.3: Element 'teiHeader' cannot have character [children], because the type's content type is element-only.</message> <message level="Error" line="1" column="69">cvc-complex-type.2.4.b: The content of element 'teiHeader' is not complete. One of '{"http://www.tei-c.org/ns/1.0":fileDesc}' is expected.</message> <message level="Error" line="1" column="75">cvc-complex-type.2.4.b: The content of element 'TEI' is not complete. One of '{"http://www.tei-c.org/ns/1.0":text}' is expected.</message> </report> I checked the schema, there seems nothing wrong with it. The bulk of spurious error messages in the first run only occur when the validation cache is empty. Best, Ron |