Unspecific schematron message with inconsistent schemaLocati
Posted: Wed Apr 08, 2015 11:30 am
Following (invalid but still occuring) scenario:
Root.xml:
Child.xml:
Now this is obviously invalid since the Root and Child elements have different values for xsi:noNamespaceSchemaLocation. And when validating the Root.xml with Rood.xsd without(!) embedded schematron, I get a suitable error message:
"XTTE1515: xsi:noNamespaceSchemaLocation cannot appear after the first no-namespace element or attribute"
When changing the xsi:noNamespaceSchemaLocation in Child.xml to Root.xsd everything is fine.
Now when validating Root.xml with(!) embedded schematron I get only this somewhat unspecific error message:
"XTTE1515: One or more validation errors were reported"
(It took me quite a while to figure out the actual problem.)
When executing the xslt generated from the schematron rules manually, the missing (helpful) error message is shown. Thus, oxygen seems to hide it:
Just for completeness of my test-case:
Root.xsd
Child.xsd:
Regards,
Patrik
Root.xml:
Code: Select all
<Root
xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
xmlns:xi = "http://www.w3.org/2001/XInclude"
xsi:noNamespaceSchemaLocation="Root.xsd">
<xi:include href="Child.xml"/>
</Root>
Code: Select all
<Child
xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
xmlns:xi = "http://www.w3.org/2001/XInclude"
xsi:noNamespaceSchemaLocation="Child.xsd">
</Child>
"XTTE1515: xsi:noNamespaceSchemaLocation cannot appear after the first no-namespace element or attribute"
When changing the xsi:noNamespaceSchemaLocation in Child.xml to Root.xsd everything is fine.
Now when validating Root.xml with(!) embedded schematron I get only this somewhat unspecific error message:
"XTTE1515: One or more validation errors were reported"
(It took me quite a while to figure out the actual problem.)
When executing the xslt generated from the schematron rules manually, the missing (helpful) error message is shown. Thus, oxygen seems to hide it:
- Child.xml: error, XTTE1515: xsi:noNamespaceSchemaLocation cannot appear after the first no-namespace element or attribute
- Root.xml: fatal, XTTE1515: One or more validation errors were reported
- Root.xml: error, XTTE1515: One or more validation errors were reported
Just for completeness of my test-case:
Root.xsd
Code: Select all
<xs:schema
xmlns:xs = "http://www.w3.org/2001/XMLSchema"
xmlns:sch = "http://purl.oclc.org/dsdl/schematron"
elementFormDefault="qualified">
<xs:include schemaLocation="Child.xsd"/>
<xs:element name="Root">
<xs:annotation>
<xs:appinfo>
<sch:pattern>
<sch:rule context="Root">
<sch:report test="true()">Test</sch:report>
</sch:rule>
</sch:pattern>
</xs:appinfo>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element ref="Child"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Code: Select all
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xs:element name="Child"/>
</xs:schema>
Patrik