Hello!

I'm a portuguese boy and i have a problem parsing an document xml-schema
with namespaces.
I don�t be certainly that the problem is in bad declaration of the attribute
isbn.

the document xml is:

<?xml version="1.0" encoding="utf-8"?>
<book isbn="0836217462"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
                        xmlns="http://example.org/ns/books/";
                        xsi:schemaLocation="http://example.org/ns/books/
book.xsd">
                        
 <title>Being a Dog Is a Full-Time Job</title>
 <author>Charles M. Schulz</author>
 <character>
  <name>Snoopy</name>
  <friend-of>Peppermint Patty</friend-of>
  <since>1950-10-04</since>
  <qualification>
    extroverted beagle
  </qualification>
 </character>
 <character>
  <name>Peppermint Patty</name>
  <since>1966-08-22</since>
  <qualification>bold, brash and tomboyish</qualification>
 </character>
</book>

and the schema is:

<?xml version="1.0" encoding="utf-8" ?> 
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema";
        xmlns="http://example.org/ns/books/";
        targetNamespace="http://example.org/ns/books/";
        elementFormDefault="qualified"
        attributeFormDefault="unqualified">

<xsd:attribute name="isbn" type="xsd:string"/>

<xsd:element name="book">
  <xsd:complexType>
    <xsd:sequence>
      <xsd:element name="title" type="xsd:string" /> 
      <xsd:element name="author" type="xsd:string" /> 
      <xsd:element name="character" minOccurs="0" maxOccurs="unbounded">
         <xsd:complexType>
            <xsd:sequence>
               <xsd:element name="name" type="xsd:string" /> 
               <xsd:element name="friend-of" type="xsd:string" minOccurs="0"
maxOccurs="unbounded" /> 
               <xsd:element name="since" type="xsd:date" /> 
               <xsd:element name="qualification" type="xsd:string" /> 
            </xsd:sequence>
         </xsd:complexType>
      </xsd:element>
    </xsd:sequence>
    <xsd:attribute ref="isbn"/>
    <!--xsd:attribute name="isbn" type="xsd:string" /--> 
  </xsd:complexType>
</xsd:element>

</xsd:schema>


and the error that i have from the parser is:

[Error] book.xml:5:84: Attribute "isbn" must be declared for element type
"book"
.

what�s wrong in this declaration?

thanks very much!

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

Reply via email to