You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Anoop Singh Saharan <an...@wipro.com> on 2001/09/11 09:55:56 UTC
Prob in Validating With Schema!!
Hi All,
I am trying to validate a Xml Document with Schema using xerces1.3.1,
XML Document is------
<?xml version="1.0"?>
<letterBody xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.w3.org/2001/XMLSchema d:\MixedContentSchema.xsd">
<salutation>Dear Mr.<name>Robert Smith</name>.</salutation>
<quantity>1</quantity> <productName>Baby
Monitor</productName> date
<shipDate>1999-05-21</shipDate>
</letterBody>
Schema is----------------
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="letterBody">
<xsd:complexType mixed="true">
<xsd:sequence>
<xsd:element name="salutation">
<xsd:complexType mixed="true">
<xsd:sequence>
<xsd:element name="name" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="quantity" type="xsd:positiveInteger"/>
<xsd:element name="productName" type="xsd:string"/>
<xsd:element name="shipDate" type="xsd:date" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:schema>
but i am getting following errors----------
3:96: Error is :Element type "letterBody" must be declared.
6:13: Error is :Element type "salutation" must be declared.
6:27: Error is :Element type "name" must be declared.
7:12: Error is :Element type "quantity" must be declared.
7:38: Error is :Element type "productName" must be declared.
9:11: Error is :Element type "shipDate" must be declared.
Please suggest me where i am wrong!!!!
regards
Anoop Singh
Re: Prob in Validating With Schema!!
Posted by Elena Litani <el...@ca.ibm.com>.
Hi, Anoop,
> I am trying to validate a Xml Document with Schema using xerces1.3.1,
> <letterBody xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:noNamespaceSchemaLocation="http://www.w3.org/2001/XMLSchema
You use incorrect syntax for xsi:noNamespaceSchemaLocation -- it should
only include "a URI reference as a hint as to the location of a schema
document with no targetNamespace [attribute]". See "4.3 Layer 3: Schema
Document Access and Web-interoperability".
Becides that, why do you use Xerces 1.3.1? It does not have full XML
Schema support. The latest Xerces release is 1.4.3.
Elena.
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org