You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Chris Halverson <ch...@ncube.com> on 2001/08/30 15:59:26 UTC

Validation and schema hierarchies

I'm getting these errors, I think its a namespace thing but I'm not sure.  I
would appreciate any help
in the offing.

[Error] :8:33: Element type "version" must be declared.
[Error] :8:33: Attribute "major" must be declared for element type
"version".
[Error] :8:33: Attribute "minor" must be declared for element type
"version".
[Error] :9:42: Element type "property" must be declared.
[Error] :9:42: Attribute "key" must be declared for element type "property".
[Error] :9:42: Attribute "value" must be declared for element type
"property".

With this instance document

<?xml version="1.0" encoding="UTF-8"?>
<XMLDataSet xmlns="http://www.ncube.com/2001/nable/1.7" 
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
	xsi:schemaLocation="http://www.ncube.com/2001/nable/1.7
CMS-DataStructure.xsd" 
	elementId="n_999" name="Test Set" authenticationString="authstring">
	<Category elementId="n_1000" name="Action" dvbCode="String"
rating="String" isAdult="1" channelIdent="String">
		<version major="2" minor="2"/>
		<property key="String" value="String"/>
		<property key="String" value="String"/>
		<note>String</note>
		<note>String</note>
		<CategoryRef>String</CategoryRef>
		<FileRef>String</FileRef>
		<FileRef>String</FileRef>
		<CategoryName elementId="n_1001" language="String"
name="String">
			<property key="String" value="String"/>
			<property key="String" value="String"/>
		</CategoryName>
		<CategoryName elementId="n_1002" language="String"
name="String">
			<property key="String" value="String"/>
			<property key="String" value="String"/>
		</CategoryName>
	</Category>

With this extended schema definition in CMS-DataStructure.xsd
<?xml version="1.0" encoding="UTF-8"?>
<schema 
	targetNamespace="http://www.ncube.com/2001/nable/1.7" 
	xmlns:nxs="http://www.ncube.com/2001/nable/1.7" 
	xmlns="http://www.w3.org/2001/XMLSchema" 
	elementFormDefault="qualified" attributeFormDefault="unqualified">
	<annotation>
		<documentation xml:lang="en">
 Metadata schema base types for nCUBE Corporation nABLE Metadata API.
 Copyright 2001 nCUBE Corp. All rights reserved.
 </documentation>
	</annotation>
	<include schemaLocation="TypeLibrary-cms.xsd"/>
	<element name="Category">
		<complexType>
			<complexContent>
				<extension base="nxs:Category">
					<sequence>
						<element name="CategoryRef"
type="nxs:CategoryRef" minOccurs="0"/>
						<element name="FileRef"
type="nxs:FileRef" minOccurs="0" maxOccurs="unbounded"/>
						<element name="CategoryName"
type="nxs:CategoryName" maxOccurs="unbounded"/>
					</sequence>
				</extension>
			</complexContent>
		</complexType>
	</element>
</schema>

Based on this underlying schema definition in TypeLibrary-cms.xsd

<?xml version="1.0" encoding="UTF-8"?>
<schema 
	targetNamespace="http://www.ncube.com/2001/nable/1.7" 
	xmlns:nxs="http://www.ncube.com/2001/nable/1.7" 
	xmlns="http://www.w3.org/2001/XMLSchema" 
	elementFormDefault="unqualified" attributeFormDefault="unqualified">
	<complexType name="Version">
		<attribute name="major" type="positiveInteger"
use="required"/>
		<attribute name="minor" type="positiveInteger"
use="required"/>
	</complexType>
	<complexType name="Property">
		<attribute name="key" type="string" use="required"/>
		<attribute name="value" type="string" use="required"/>
	</complexType>
	<complexType name="Category">
		<sequence>
			<element name="version" type="nxs:Version"/>
			<element name="property" type="nxs:Property"
minOccurs="0" maxOccurs="unbounded"/>
			<element name="note" type="nxs:Note" minOccurs="0"
maxOccurs="unbounded"/>
		</sequence>
		<attribute name="elementId" type="ID" use="required"/>
		<attribute name="name" type="string" use="required"/>
		<attribute name="dvbCode" type="string" use="required"/>
		<attribute name="rating" type="string" use="required"/>
		<attribute name="isAdult" type="boolean" use="required"/>
		<attribute name="channelIdent" type="string"/>
	</complexType>
</schema>