|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Simple Schema
Hi KRUMPOLEC Martin / Henry S. Thompson,
The things are not still working. I am using Xerces2.0.0(Java version). I
have all the setup in solaris. I have written a java program which parses
the XML(i am not opening on a Browser, i just run the java program). The
same thing works fine when i use DTD in place of XML-schema. Is there any
dll's to be installed when i use XML-Schema?. I have given u the XML file
and .XSD file below. I think the XML file is not able to locate the Schema
file(.xsd).
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="note">
<xs:complexType>
<xs:sequence>
<xs:element name="to" type="xs:string" minOccur="1" maxOccur="5"/>
<xs:element name="heading" type="xs:string" minOccur="1"
maxOccur="5"/>
<xs:element name="body" type="xs:string" minOccur="1" maxOccur="5"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
The following is the corresponding XML file.
<?xml version="1.0"?>
<note xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="xmlsch.xsd">
<to>Tove</to>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>
The following is the error thrown while parsing(ie while running the java
file).
Error: org.xml.sax.SAXParseException: Element type "note" must be declared.
Error: org.xml.sax.SAXParseException: Element type "to" must be declared.
Error: org.xml.sax.SAXParseException: Element type "heading" must be
declared.
Error: org.xml.sax.SAXParseException: Element type "body" must be declared.
<note xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="xmlschbak.xsd">
Regards
Raja
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|
|||||||||

Cart








