| Article: |
XML Document Validation with an XML Schema | |
| Subject: | Handler exception | |
| Date: | 2006-06-14 02:35:57 | |
| From: | nnc | |
|
i am trying to use jdk1.4 SAXParserFactory and with setValidating(true) it doesnot recognize the attributes or xml tags.
|
||
Showing messages 1 through 2 of 2.
-
Handler exception
2006-06-14 07:23:45 Deepak Vohra [Reply | View]
Please post the XML document and XML Schema. -
Handler exception
2006-06-14 21:44:49 nnc [Reply | 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>




