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

RE: validating schema instance with xerces?

  • From: johns@s... (John F. Schlesinger)
  • To: LKirschner@v..., xml-dev@l...
  • Date: Fri, 30 Mar 2001 18:55:28 -0500

schema instance
The reason you are getting the message is because
http://schemahost/xml/namespaces/db_bean/db_bean.xsd, the location for your
schema, is not a valid location. At least, I can't get to it from my
browser... You need to place your schema somewhere accessible and address it
with the schemaLocation attribute.
John F Schlesinger
SysCore Solutions

-----Original Message-----
From: LKirschner@v... [mailto:LKirschner@v...]
Sent: Friday, March 30, 2001 2:23 AM
To: xml-dev@l...
Subject: validating schema instance with xerces?


This is a light-weight question for this group, but I don't know where else
to post it, and I could really use some help. I am having trouble
validating documents against a schema with xerces1.2.3.  The schema is at
the url indicated in the instance document and it is world readable, but I
keep getting the following error:

org.xml.sax.SAXParseException: General Schema Error: Grammar with uri 2:
http://schemahost/xml/namespaces/db_bean , can not found.

My schema and instance document are as follows:

Instance doc:

<?xml version="1.0" ?>

     <db_bean xmlns="http://schemahost/xml/namespaces/db_bean"
     xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance"
     xsi:schemaLocation="http://schemahost/xml/namespaces/db_bean
     http://schemahost/xml/namespaces/db_bean/db_bean.xsd"
     class="com.vencast.bean.db.DealCategory">
        <property name="Seq">
            <java.lang.Integer>6</java.lang.Integer>
        </property>
        <property name="DealId">
            <java.lang.Integer>9999</java.lang.Integer>
        </property>
        <property name="CategoryId">
            <java.lang.Integer>11256</java.lang.Integer>
        </property>
        <property name="LevelId">
            <java.lang.Integer>1</java.lang.Integer>
        </property>
        <property name="ParentCategoryId">
            <java.lang.Integer>11256</java.lang.Integer>
        </property>
        <property name="DefaultSubcategoryId">
            <java.lang.Integer>0</java.lang.Integer>
        </property>
        <property name="CategoryDesc">
            <java.lang.String>Q &amp; A</java.lang.String>
        </property>
        <property name="TargetUrl">
            <java.lang.String>contentdisplay.jhtml</java.lang.String>
        </property>
       <property name="CategoryDescU">
            <java.lang.String>q_n_a</java.lang.String>
        </property>
        <property name="LastUpdateDate">
            <java.sql.Date>2001-03-13</java.sql.Date>
        </property>
        <property name="LastUpdateBy">
            <java.lang.Integer>351700193</java.lang.Integer>
        </property>
        <property name="VirtualDelete">
            <java.lang.Integer>0</java.lang.Integer>
        </property>
    </db_bean>



Schema:

<schema xmlns="http://www.w3.org/2000/10/XMLSchema"
          targetNamespace="http://schemahost/xml/namespaces/db_bean"
          xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance"
          xsi:schemaLocation="http://www.w3.org/2000/10/XMLSchema
          http://www.w3.org/2000/10/XMLSchema.xsd"
          elementFormDefault="qualified"
        >
     <element name="db_bean">
        <complexType>
               <annotation>
                    <documentation></documentation>
               </annotation>
               <sequence>
                    <element name="property" minOccurs="0" maxOccurs
="unbounded" >
                         <complexType>
                              <choice>
                                   <element name="java.lang.Boolean" type
="boolean" />
                                   <element name="java.lang.Byte" type
="byte" />
                                   <element name="java.sql.Date"  >
                                         <complexType>
                                              <simpleContent>
                                                   <extension base="date" >
                                                        <attribute name
="pattern" type="string" use="fixed" value="yyyy-MM-dd" />
                                                   </extension>
                                              </simpleContent>
                                         </complexType>
                                   </element>
                                   <element name="java.lang.Double" type
="double" />
                                   <element name="java.lang.Float" type
="float" />
                                   <element name="java.lang.Integer" type
="integer" />
                                   <element name="java.lang.Long" type
="long" />
                                   <element name="java.lang.Short" type
="short" />
                                   <element name="java.lang.String" type
="string" />
                                   <element name="java.sql.Time" >
                                         <complexType>
                                              <simpleContent>
                                                   <extension base="time" >
                                                        <attribute name
="pattern" type="string" use="fixed" value="yyyy-MM-ddHH:mm:ss.SS0" />
                                                        <attribute name
="zero_epoch" type="string" use="fixed" value="1970-01-01" />
                                                   </extension>
                                              </simpleContent>
                                         </complexType>
                                   </element>
                                   <element name="java.sql.Timestamp"  >
                                         <complexType>
                                              <simpleContent>
                                                   <extension base
="timeInstant" >
                                                        <attribute name
="pattern" type="string" use="fixed" value="yyyy-MM-ddTHH:mm:ss-SS-00" />
                                                   </extension>
                                              </simpleContent>
                                         </complexType>
                                   </element>
                              </choice>
                              <attribute name="name" use="required" >
                                   <simpleType>
                                         <restriction base="string" >
                                              <pattern value="[a-z|A-Z|_]
[\w|_]*" >
                                                   <annotation>

<documentation>java_names must follow Java class naming rules: the first
character must be a letter or '_'; the characters that follow may be
letters, '_', or numbers</documentation>
                                                   </annotation>
                                              </pattern>
                                         </restriction>
                                   </simpleType>
                              </attribute>
                         </complexType>
                    </element>
               </sequence>
               <attribute name="class" use="required" >
                    <simpleType>
                         <restriction base="string" >
                              <pattern value="[a-z|A-Z|_][\w|_|.]*" >
                                   <annotation>
                                         <documentation>java_names must
follow Java class naming rules: the first character must be a letter or '
_'; the characters that follow may be letters, '_', or numbers. Periods can
be used for package delimitation: ie com.vencast.SomeClass</documentation>
                                   </annotation>
                              </pattern>
                         </restriction>
                    </simpleType>
               </attribute>
          </complexType>
     </element>
</schema>



------------------------------------------------------------------
The xml-dev list is sponsored by XML.org, an initiative of OASIS
<http://www.oasis-open.org>

The list archives are at http://lists.xml.org/archives/xml-dev/

To unsubscribe from this elist send a message with the single word
"unsubscribe" in the body to: xml-dev-request@l...


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.