DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=9761>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=9761 Schema Validation not working with multiple namespaces Summary: Schema Validation not working with multiple namespaces Product: Xerces2-J Version: 2.0.1 Platform: Other URL: http://marc.theaimsgroup.com/?l=xerces-j- user&m=100896369913783&w=2 OS/Version: Other Status: NEW Severity: Major Priority: Other Component: XML Schema datatypes AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] I found this posted on the xerces-j-user newsgroup, with no replies. The bug was found in 1.4.4, but I still find errors (though different text now) in 2.0.1 and in CVS's 2002-06-10 build. http://marc.theaimsgroup.com/?l=xerces-j-user&m=100896369913783&w=2 Here's a copy in plain text: ================ BEGIN COPY =============================== List: xerces-j-user Subject: Xerces 1.4.4 validation question From: A Yang <[EMAIL PROTECTED]> Date: 2001-12-21 19:41:32 Hi, I'm using Xerces 1.4.4 and trying to validate a very simple test case of multiple namespaces across multiple schemas. In this example, I've got two base schemas (Product.xsd and Person.xsd) being used by a third (Company.xsd). This is actually an example taken verbatim from www.xfront.com. Eyeballing the schemas and instances, I can't find what's wrong and why the Company element is not being found valid. Any help would be appreciated. Thanks, Andy Product.xsd-------------------------------------------- <?xml version="1.0"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.product.org" xmlns="http://www.product.org" elementFormDefault="unqualified"> <xsd:complexType name="ProductType"> <xsd:sequence> <xsd:element name="Type" type="xsd:string"/> </xsd:sequence> </xsd:complexType> </xsd:schema> Person.xsd-------------------------------------------- <?xml version="1.0"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.person.org" xmlns="http://www.person.org" elementFormDefault="unqualified"> <xsd:complexType name="PersonType"> <xsd:sequence> <xsd:element name="Name" type="xsd:string"/> <xsd:element name="SSN" type="xsd:string"/> </xsd:sequence> </xsd:complexType> </xsd:schema> Company.xsd-------------------------------------------- <?xml version="1.0"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.company.org" xmlns="http://www.company.org" elementFormDefault="unqualified" xmlns:per="http://www.person.org" xmlns:pro="http://www.product.org"> <xsd:import namespace="http://www.person.org" schemaLocation="Person.xsd"/> <xsd:import namespace="http://www.product.org" schemaLocation="Product.xsd"/> <xsd:element name="Company"> <xsd:complexType> <xsd:sequence> <xsd:element name="Person" type="per:PersonType" maxOccurs="unbounded"/> <xsd:element name="Product" type="pro:ProductType" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:schema> company.xml-------------------------------------------- <?xml version="1.0"?> <Company xmlns="http://www.company.org" xmlns:pro="http://www.product.org" xmlns:per="http://www.person.org" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation= "http://www.company.org Company.xsd"> <Person> <per:Name>John Doe</per:Name> <per:SSN>123-45-6789</per:SSN> </Person> <Product> <pro:Type>Widget</pro:Type> </Product> </Company> Execution:--------------------------------------------- java sax.SAXCount -v -n -s -p org.apache.xerces.par sers.SAXParser company.xml The output:-------------------------------------------- [Error] company.xml:9:17: Element type "Person" must be declared. [Error] company.xml:10:27: Element type "per:Name" must be declared. [Error] company.xml:11:26: Element type "per:SSN" must be declared. [Error] company.xml:13:18: Element type "Product" must be declared. [Error] company.xml:14:27: Element type "pro:Type" must be declared. [Error] company.xml:16:12: The content of element type "Company" must match "(Pe rson+,Product+)". company.xml: 547 ms (6 elems, 5 attrs, 19 spaces, 94 chars) ================ END COPY ================================= Thanks! --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
