Subject:Validation error using Include with namespace prefix -ok in XmlSpy. Which one is correct? Author:wayne albury Date:02 Oct 2006 08:25 AM Originally Posted: 02 Oct 2006 08:17 AM
Unsure if there is a setting I am missing but thought I'd raise it anyway - using Xml Ent. Suite 2007 (eval)
File 1:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:agls="http://www.agls.gov.au/xml/1.2"
targetNamespace="http://www.agls.gov.au/xml/1.2" elementFormDefault="qualified">
<xsd:include schemaLocation="aglsaudience.xsd"/>
<xsd:element name="aglsschema">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="filler" minOccurs="1" maxOccurs="unbounded">
</xsd:element>
<xsd:element type="audience" name="audience" minOccurs="1" maxOccurs="unbounded">
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
File 2: (included)
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
<xsd:simpleType name="audience">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="All">
</xsd:enumeration>
<!-- snip...-->
<xsd:enumeration value="Youth">
</xsd:enumeration>
</xsd:restriction>
</xsd:simpleType>
</xsd:schema>
Validating aglsschema.xsd...
file:///g:/Xml/VERS/AglsTest/aglsschema.xsd:11,86: Type not found in :audience
The XML document aglsschema.xsd is NOT valid (1 errors)
Remove the :agls (from xmlns:agls) and it is fine.
XmlSpy gives no error. I am unsure which implementation is technically correct - any ideas anyone?
Thanks!