[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Simple Schema

  • To: <xml-dev@l...>
  • Subject: Re: Simple Schema
  • From: "rajac" <rajac@n...>
  • Date: Mon, 11 Feb 2002 04:59:19 +0530
  • References: <5C9461BDD6ABD511815500D0B7B7A0E2247F6F@n...-internal>

xs element type
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!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.