[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
validating schema instance with xerces?
- From: LKirschner@vencast.com
- To: xml-dev@lists.xml.org
- Date: Fri, 30 Mar 2001 02:23:28 -0500
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 & 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>