You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Ralph Largo <ra...@ralphontheweb.com> on 2000/10/13 00:49:12 UTC
Newbie needs help...
I have the DOMWriter from the Xerces examples. I can run it against the personal-schema.xml file just fine, and the parser works as advertised. However, when I try to use the examples out of the Primer, I get this error. Can anyone help me? I am scratching my head wondering why this error is happening. I thought that you could declare a namespace without something actually being at the URI? (There is a directory at f:\InetPub\wwwroot\Schema):
IPO.XSD FILE:
<schema targetNamespace="http://www.ralphontheweb.com/Schema/IPO"
xmlns="http://www.w3.org/2000/10/XMLSchema"
xmlns:ipo="http://www.ralphontheweb.com/Schema/IPO">
<annotation>
<documentation>
International Purchase order schema for Example.com
Copyright 2000 Example.com. All rights reserved.
</documentation>
</annotation>
<!-- include address constructs -->
<include
schemaLocation="http://www.ralphontheweb.com/Schema/address.xsd"/>
<element name="purchaseOrder" type="ipo:PurchaseOrderType"/>
<element name="comment" type="string"/>
<complexType name="PurchaseOrderType">
<sequence>
<element name="shipTo" type="ipo:Address"/>
.
.
.
(etc)
XML FILE:
<?xml version="1.0"?>
<ipo:purchaseOrder
xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance"
xmlns:ipo="http://www.ralphontheweb.com/Schema/IPO"
xsi:schemaLocation="http://www.ralphontheweb.com/Schema/ipo.xsd"
orderDate="1999-12-01">
<shipTo exportCode="1" xsi:type="ipo:UKAddress">
<name>Helen Zoe</name>
.
.
.
(etc)
ERROR OUTPUT:
[Error] ipo.xml:6:26: General Schema Error: Grammar with uri : http://www.ralphontheweb.com/Schema/IPO , can not found.
[Error] ipo.xml:6:26: Element type "ipo:purchaseOrder" must be declared.
[Error] ipo.xml:8:53: Element type "shipTo" must be declared.
[Error] ipo.xml:9:15: Element type "name" must be declared.
[Error] ipo.xml:10:17: Element type "street" must be declared.
[Error] ipo.xml:11:15: Element type "city" must be declared.
[Error] ipo.xml:12:19: Element type "postcode" must be declared.
.
.
(etc)
Thanks in advance for your help.
Ralph Largo
Voice: 651.481.0126
Web: www.ralphontheweb.com
E-Mail: ralph@ralphontheweb.com
Re: Newbie needs help...
Posted by Andy Clark <an...@apache.org>.
Jerry Lawson wrote:
> To the xerces-j code submitters: wouldn't it make more better
> sense to have the exception print a string such as 'schemaLocation
> grammar incorrect; expected "uri filename"' or something more
> meaningful than the badly mangled "can not found" message ?
Yep! Post the patch to the XMLValidator and/or error message
files and one of the committers will apply the changes for
you.
--
Andy Clark * IBM, JTC - Silicon Valley * andyc@apache.org