I have included the schema and xml file that I am using in the
validation. I have found that there is a problem when trying to validate
the xml when a schema type references itself, like the CategoryType does.
I did not find any references in the Schema lang. that forbids me doing
this. So, I figured I would send it to you guys and see if you know about
this problem and figure out if it is my problem or yours!

Here is the output I get when I run the command: SAX2Print event.xml

<?xml version="1.0" encoding="LATIN1"?>
<event xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:noNamespaceSchemaLocation="event.xsd">
    <category name="stockmarket">
        <subcategory name="stocks">
            
Error at file /corliss/personal/homework/thesis/event.xml, line 6, char 44
  Message: Unknown element 'subcategory'

Error at file /corliss/personal/homework/thesis/event.xml, line 6, char 44
  Message: Attribute '{}name' is not declared for element 'subcategory'
<subcategory name="technology">
                
Error at file /corliss/personal/homework/thesis/event.xml, line 7, char 54
  Message: Unknown element 'attribute'

Error at file /corliss/personal/homework/thesis/event.xml, line 7, char 54
  Message: Attribute '{}name' is not declared for element 'attribute'

Error at file /corliss/personal/homework/thesis/event.xml, line 7, char 54
  Message: Attribute '{}type' is not declared for element 'attribute'
<attribute name="name" type="string">STK</attribute>
                
Error at file /corliss/personal/homework/thesis/event.xml, line 8, char 38
  Message: Unknown element 'record'

Error at file /corliss/personal/homework/thesis/event.xml, line 8, char 38
  Message: Attribute '{}name' is not declared for element 'record'
<record name="price">
                    
Error at file /corliss/personal/homework/thesis/event.xml, line 9, char 58
  Message: Unknown element 'attribute'

Fatal Error at file /corliss/personal/homework/thesis/event.xml, line 9,
char 58  Message: The attribute 'name' is already used in element
'attribute'


If I take out the subcategory tags in the xml then everything works fine.
Thanks for any help,
Chris Corliss
<schema 

xmlns="http://www.w3.org/2001/XMLSchema";

>



<annotation>

    <documentation xml:lang="en">

        Event for Siena Event Notifcation System.

        Copyright 2001 Unviersity of Colorado. All rights reserved.

    </documentation>

</annotation>



<element name="event">

    <complexType>

        <sequence>

            <element name="category" type="sen:CategoryType"/>

            <element name="timestamp" type="sen:TimeStampType" minOccurs='0'/>

        </sequence>

    </complexType>

</element>

        



<complexType name="CategoryType">

    <sequence>

        <element name="subcategory" type="sen:SubCategoryType" minOccurs='0' 
maxOccurs="unbounded"/>

        <element name="attribute" type="sen:attribute" minOccurs='0' 
maxOccurs="unbounded"/>

        <element name="record" type="sen:record" minOccurs='0' maxOccurs="unbounded"/>

    </sequence>

    <attribute name="name" type="string"/>

</complexType>



<complexType name="SubCategoryType">

    <sequence>

        <element name="subcategory" type="sen:SubCategoryType" minOccurs='0' 
maxOccurs="unbounded"/>

        <element name="attribute" type="sen:attribute" minOccurs='0' 
maxOccurs="unbounded"/>

        <element name="record" type="sen:record" minOccurs='0' maxOccurs="unbounded"/>

    </sequence>

    <attribute name="name" type="string"/>

</complexType>



<complexType name="attribute">

    <simpleContent>

        <extension base="string">

            <attribute name="name" type="string"/>

            <attribute name="type" type="sen:AttributeTypes"/>

        </extension>

    </simpleContent>

</complexType>



<complexType name="record">

    <sequence>

        <element name="attribute" type="sen:attribute" minOccurs='0' 
maxOccurs="unbounded"/>

        <element name="record" type="sen:record" minOccurs='0' maxOccurs="unbounded"/>

    </sequence>

    <attribute name="name" type="string"/>

</complexType>



<complexType name="TimeStampType">

    <sequence>

        <element name="time" type="string"/>

        <element name="day" type="integer"/>

        <element name="month" type="sen:Months"/>

        <element name="year" type="integer"/>

    </sequence>

</complexType>



<simpleType name="AttributeTypes">

    <restriction base="string">

        <enumeration value="int"/>

        <enumeration value="string"/>

        <enumeration value="char"/>

        <enumeration value="float"/>

        <enumeration value="boolean"/>

    </restriction>

</simpleType>



<simpleType name="Months">

    <restriction base="string">

        <enumeration value="Janurary"/>

        <enumeration value="Feburary"/>

        <enumeration value="March"/>

        <enumeration value="April"/>

        <enumeration value="May"/>

        <enumeration value="June"/>

        <enumeration value="July"/>

        <enumeration value="August"/>

        <enumeration value="September"/>

        <enumeration value="October"/>

        <enumeration value="November"/>

        <enumeration value="December"/>

    </restriction>

</simpleType>

</schema>



<?xml version="1.0" encoding="LATIN1" ?>
<event xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
       xsi:noNamespaceSchemaLocation='event.xsd'>
    <category name="stockmarket">
        <subcategory name="stocks">
            <attribute name="name" type="string">STK</attribute>
            <record name="price">
                <attribute name="current" type="int">17.75</attribute>
                <attribute name="change" type="int">7.10</attribute>
                <attribute name="opening" type="int">10.65</attribute>
                <attribute name="closing" type="int">17.75</attribute>
            </record>
            <record name="date">
                <attribute name="day" type="int">23</attribute>
                <attribute name="month" type="string">July</attribute>
                <attribute name="year" type="int">2001</attribute>
            </record>
        </subcategory>
    </category>
    <timestamp>
        <time>12:25:31</time>
        <day>23</day>
        <month>July</month>
        <year>2001</year>
    </timestamp>
</event>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to