Oxygen / Schematron using wrong schema
Posted: Wed Jan 13, 2016 1:49 am
Oxygen / Schematron using wrong schema.
I am experiencing different results than another user in my group running the same test with the same files.
Therefore I suspect this is a Preferences setting.
I first experienced this issue after upgrading from Oxygen 16.1 to 17.1 (the version the other person is using)
I am using a Schematron schema to validate an XML file.
The schema for the XML file being validated has an element named <item> with attributes @href and @title.
The Schematron schema references an external file using the document($path) function to connect to an XML file.
The schema for the XML referenced file also contains an element named <item> with attributes @key and @value
The error that I am receiving is saying the attribute on the referenced file <item> element is not allowed:
- Attribute @key is not allowed on element <item>
It seems like Oxygen is trying to validate the reference XML file with the "wrong" schema.
I would suspect that I need to name space the referenced file but the same files work for another person in our group.
Can anyone tell me what Preference setting might be causing this or how to resolve it in some other way?
The definition for <item> in the referenced file is:
The definition for <item> in the XML file I am trying to validate is:
Here is my schematron file:
Here is the schema for the referenced XML file:
Here is the referenced XML file:
Here is the XML file I am trying to validate:
Here is the schema for the XML file that I am trying to validate:
I am experiencing different results than another user in my group running the same test with the same files.
Therefore I suspect this is a Preferences setting.
I first experienced this issue after upgrading from Oxygen 16.1 to 17.1 (the version the other person is using)
I am using a Schematron schema to validate an XML file.
The schema for the XML file being validated has an element named <item> with attributes @href and @title.
The Schematron schema references an external file using the document($path) function to connect to an XML file.
The schema for the XML referenced file also contains an element named <item> with attributes @key and @value
The error that I am receiving is saying the attribute on the referenced file <item> element is not allowed:
- Attribute @key is not allowed on element <item>
It seems like Oxygen is trying to validate the reference XML file with the "wrong" schema.
I would suspect that I need to name space the referenced file but the same files work for another person in our group.
Can anyone tell me what Preference setting might be causing this or how to resolve it in some other way?
The definition for <item> in the referenced file is:
Code: Select all
<xs:element name="item">
<xs:complexType>
<xs:attribute name="key"/>
<xs:attribute name="value"/>
</xs:complexType>
</xs:element>
Code: Select all
<xs:element name="item" type="itemType"/>
<xs:complexType name="itemType">
<xs:sequence>
<xs:element ref="item" maxOccurs="unbounded" minOccurs="0"/>
</xs:sequence>
<xs:attribute name="href" type="xs:anyURI"/>
<xs:attribute name="title" type="xs:string" use="required"/>
</xs:complexType>
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
<pattern id="metaPiValidation">
<let name="regid" value="'documentTypes.xml'"/>
<let name="path" value="concat('file:/Y:/documentation/Schematron/SchematronSchemasEtc/registryXml/', $regid)"/>
<let name="categories" value="document($path)"/>
<rule context="/Document/ContentFile">
<report test="1">XML: <value-of select="$categories"/></report>
</rule>
</pattern>
</schema>
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0">
<xs:element name="registry">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element ref="entry" maxOccurs="unbounded"/>
</xs:choice>
<xs:attribute name="schemaVersion" />
<xs:attribute name="identity" type="xs:NCName"/>
<xs:attribute name="modified" type="xs:dateTime" />
</xs:complexType>
</xs:element>
<xs:element name="entry">
<xs:complexType>
<xs:sequence>
<xs:element ref="item" maxOccurs="unbounded">
</xs:element>
</xs:sequence>
<xs:attribute name="status"/>
<xs:attribute name="modified"/>
</xs:complexType>
</xs:element>
<xs:element name="item">
<xs:complexType>
<xs:attribute name="key">
</xs:attribute>
<xs:attribute name="value">
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<registry xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="file:/Y:/documentation/Projects/DDMF/schema/1-0/registry.xsd"
schemaVersion="1.0"
identity="documentTypes"
modified="2015-07-07T11:29:02">
<entry status="stable" modified="2015-07-07T17:30:00Z" >
<item key="ns" value="TBC"/>
<item key="documentType" value="AAAE"/>
<item key="fic" value=""/>
<item key="documentTypeDisCo" value=""/>
<item key="category" value="CAT1001"/>
<item key="group" value=""/>
<item key="name" value="Electrical/Mechanical Parts Substitution"/>
<item key="supersededBy" value=""/>
</entry>
</registry>
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<Document xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="file:/Y:/documentation/Projects/DDMF/Schematron/demo.xsd" >
<status>test</status>
<packageTimestamp>2015-12-17T23:52:00Z</packageTimestamp>
<files>
<ContentFile>
<fileName>myFile.pdf</fileName>
<mediaType>application/pdf</mediaType>
</ContentFile>
</files>
<tableOfContents>
<item title="Title for My File">
<item href="myFile.pdf" title="The Real title of my document"/>
</item>
</tableOfContents>
</Document>
Code: Select all
<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" version="3.0">
<xs:element name="Document">
<xs:complexType>
<xs:sequence maxOccurs="1">
<xs:element ref="status"/>
<xs:element ref="packageTimestamp"/>
<xs:element name="files" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:element ref="ContentFile" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element ref="tableOfContents" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="ContentFile">
<xs:complexType>
<xs:sequence maxOccurs="1">
<xs:group ref="file"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="fileName" type="xs:anyURI"/>
<xs:element name="item" type="itemType"/>
<xs:element name="mediaType"/>
<xs:element name="packageTimestamp" type="xs:dateTime"/>
<xs:element name="status"/>
<xs:element name="tableOfContents">
<xs:complexType>
<xs:sequence>
<xs:element ref="item"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:group name="file">
<xs:sequence>
<xs:element ref="fileName"/>
<xs:element ref="mediaType" minOccurs="0"/>
</xs:sequence>
</xs:group>
<xs:complexType name="itemType">
<xs:sequence>
<xs:element ref="item" maxOccurs="unbounded" minOccurs="0"/>
</xs:sequence>
<xs:attribute name="href" type="xs:anyURI"/>
<xs:attribute name="title" type="xs:string" use="required"/>
</xs:complexType>
</xs:schema>