Women in Technology

Hear us Roar



Article:
  XML Document Validation with an XML Schema
Subject:   Handler exception
Date:   2006-06-14 07:23:45
From:   dvohra09
Response to: Handler exception

Please post the XML document and XML Schema.
Full Threads Oldest First

Showing messages 1 through 1 of 1.

  • Handler exception
    2006-06-14 21:44:49  nnc [View]

    hi Deepak,

    Many thanks for looking in to this. The xml and schema was donloaded from your site, here it is. infact it gives the same exception for all the elements in the xml file. (i tried removing the attribute)

    <?xml version="1.0" encoding="UTF-8"?>
    <!--A OnJava Journal Catalog-->

    <catalog
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation=
    "file://c:/Schemas/catalog.xsd"
    title="OnJava.com" publisher="O'Reilly">
    <journal date="April 2004">
    <article>
    <title>Declarative Programming in Java</title>
    <author>Narayanan Jayaratchagan</author>
    </article>
    </journal>
    </catalog>

    schema,

    <?xml version="1.0" encoding="utf-8"?>
    <xs:schema
    xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="catalog">
    <xs:complexType>
    <xs:sequence>
    <xs:element ref="journal" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="title" type="xs:string"/>
    <xs:attribute name="publisher" type="xs:string"/>
    </xs:complexType>
    </xs:element>
    <xs:element name="journal">
    <xs:complexType>
    <xs:sequence>
    <xs:element ref="article" minOccurs="0"
    maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="date" type="xs:string"/>
    </xs:complexType>
    </xs:element>
    <xs:element name="article">
    <xs:complexType>
    <xs:sequence>
    <xs:element name="title" type="xs:string"/>
    <xs:element ref="author" minOccurs="0"
    maxOccurs="unbounded"/>
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    <xs:element name="author" type="xs:string"/>
    </xs:schema>