someone just told me how to fix... elementFormDefault="qualified"...I'm not
entirely sure what this does, but I intend to find out.

Thanks for your help

Colin

-----Original Message-----
From: Rahul Srivastava [mailto:[EMAIL PROTECTED]
Sent: 02 November 2001 06:11
To: [EMAIL PROTECTED]
Subject: Re: xsd schema problem


> From: Colin Savage <[EMAIL PROTECTED]>
> 
> I can't figure out what is wrong with this schema, can someone please help
> (Xerces 1.4.3)
> 
> [Error] result.xml:3:12: Element type "birthday" must be declared.
> [Error] result.xml:4:9: The content of element type "gift" must match
> "(birthday)".
> <?xml version="1.0"?>
> <xs:schema
> xmlns:xs="http://www.w3.org/2001/XMLSchema";
> targetNamespace="urn:myschema">
>   <xs:element name="gift">
>     <xs:complexType>
>       <xs:sequence>
>         <xs:element name="birthday" type="xs:date"/>
>       </xs:sequence>
>     </xs:complexType>
>   </xs:element>
> </xs:schema>
> 
> <?xml version="1.0"?>
> <gift xmlns="urn:myschema">
> <birthday>2001-01-10</birthday>
> </gift>

Though there is nothing wrong with your schema/instance file. The problem
here 
is the parser is unable to resolve the namespace in the instance file to a 
grammar, as it can't find your schema file. So, if you specify a
schemaLocation 
in your instance file, things may work.

<gift xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
      xsi:schemaLocation="urn:myschema schemaFile.xsd">
  <birthday>2001-01-10</birthday>
</gift>

Other way can be to use external-schemaLocation property of xerces-j. This
is 
not yet implemented in xerces2-j.

Cheers,
Rahul.

Sun Microsystems, Inc.

> 
> Thanks
> Colin
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to