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 18:12:30 UTC

Newbie still needs help...

I'm re-posting this as I have not had any responses that solved this. My project is stalled until I find out what the problem is, so please help a poor old toothless programmer suffering from caffein withdrawal. Here is the orig. msg:

(JDK v1.3, NT 4.0 w/SP6, latest Xerces download)

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). I also tried   xsi:schemaLocation="http://www.ralphontheweb.com/Schema/IPO  http://www.ralphontheweb.com/Schema/ipo.xsd" and all possible combos:

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