[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: validating schema instance with xerces?
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 & 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! 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
|