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

schema validation question

  • To: <xml-dev@l...>
  • Subject: schema validation question
  • From: "Joe Hallett" <jhallett@m...>
  • Date: Sun, 14 Apr 2002 13:42:24 -0400

schema float with enumeration
I am trying to validate a schema instance doc against the following schema:
 
<schema xmlns="http://www.w3.org/2001/XMLSchema"
 xmlns:fac="http://localhost:8080/xmlp/xs"
        targetNamespace="http://localhost:8080/xmlp/xs">
 
 <annotation>
    <documentation>
    Developed by Joe Hallett at Colgate University.
    Defines fact data to be used by expert system processing.
    All rights reserved.
   </documentation>
 </annotation>
 
 <element name="Facts" type="fac:FactsType"/>
 <complexType name="FactsType">
  <sequence>
   <element name="Fact" type="fac:FactType" maxOccurs="unbounded"/>
  </sequence>
 </complexType>
 <complexType name="FactType">
  <sequence>
   <element name="Name" type="string"/>
   <element name="Value" type="fac:ValueUnion"/>
   <element name="Subfacts" type="fac:FactsType" minOccurs="0" maxOccurs="unbounded"/>
  </sequence>
 </complexType>
 <complexType name="ValueUnion">
  <sequence>
   <element name="String" type="string"/>
   <element name="Int" type="int" maxOccurs="unbounded"/>
   <element name="Float" type="float" maxOccurs="unbounded"/>
   <element name="Long" type="long" maxOccurs="unbounded"/>
   <element name="List" type="fac:ListType" maxOccurs="unbounded"/>
  </sequence>
 </complexType>
 <complexType name="ListType">
  <sequence>
   <element name="Type" type="fac:TypeEnum"/>
   <element name="Element" type="fac:ValueUnion" maxOccurs="unbounded"/>
  </sequence>
 </complexType>
 <simpleType name="TypeEnum">
  <restriction base="string">
   <enumeration value="string"/>
   <enumeration value="int"/>
   <enumeration value="float"/>
   <enumeration value="long"/>
   <enumeration value="list"/>
  </restriction>
 </simpleType>
</schema>
 
 
I am using Xerces 14.4 to parse the doc and have set the "http://apache.org/xml/properties/schema/external-schemaLocation" property to find the above schema.
 
The reason for the localhost:8080 URL is because I am running tomcat 4.0 to access the schema.
 
When I run the validator on the instance doc I receive errors that tell me all the element types, with the exception of the global element "Facts", must be declared.
 
Any idea??
 
Thanks for the help,
 
Joe
 

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.