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 Ravi Sikka <Ra...@LOSTWAX.COM> on 2000/08/18 15:59:23 UTC
XML validation problem
The following xml and associated schema validates ok in XML Spy but Xerces
tells me:
XML source, http://localhost/xml/sample9.xml has errors.
node=EndDate, error=at line number, 5: Element type "Year" must be declared.
node=UpdateProduct, error=at line number, 4: Element type "EndDate" must be
declared.
Can someone please tell me what I've go wrong!!
The schema:
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/1999/XMLSchema">
<element name="UpdateProduct">
<complexType>
<element name="Id" type="integer"/>
<element ref="EndDate" minOccurs="0"/>
</complexType>
</element>
<complexType name="EndDate">
<element name="Year" type="integer"/>
</complexType>
</schema>
The xml:
<?xml version="1.0" encoding="UTF-8"?>
<UpdateProduct xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://localhost/xml/namespaces/up9.xsd">
<Id>999</Id>
<EndDate>
<Year>2000</Year>
</EndDate>
</UpdateProduct>
RE: XML validation problem
Posted by rsanford <rs...@nolimitsystems.com>.
you are having the same problems i was having yesterday!!! hooray! i'm not
the only one confused!!!
was that out loud? sorry. anyway...
the link that was given to me that i found _extremely_ helpful is:
http://www.w3.org/TR/xmlschema-0/
i hope it helps you as well.
rjsjr
> -----Original Message-----
> From: Ravi Sikka [mailto:Ravi.Sikka@LOSTWAX.COM]
> Sent: Friday, August 18, 2000 8:59 AM
> To: 'xerces-j-dev@xml.apache.org'
> Subject: XML validation problem
>
>
> The following xml and associated schema validates ok in XML Spy but Xerces
> tells me:
>
> XML source, http://localhost/xml/sample9.xml has errors.
> node=EndDate, error=at line number, 5: Element type "Year" must
> be declared.
>
> node=UpdateProduct, error=at line number, 4: Element type
> "EndDate" must be
> declared.
>
> Can someone please tell me what I've go wrong!!
>
>
> The schema:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <schema xmlns="http://www.w3.org/1999/XMLSchema">
>
> <element name="UpdateProduct">
> <complexType>
> <element name="Id" type="integer"/>
> <element ref="EndDate" minOccurs="0"/>
> </complexType>
> </element>
>
> <complexType name="EndDate">
> <element name="Year" type="integer"/>
> </complexType>
>
> </schema>
>
>
> The xml:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <UpdateProduct xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
> xsi:noNamespaceSchemaLocation="http://localhost/xml/namespaces/up9.xsd">
> <Id>999</Id>
> <EndDate>
> <Year>2000</Year>
> </EndDate>
> </UpdateProduct>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-dev-help@xml.apache.org
>