Problems with Oracle XML Schema processor?

Hi,
I just installed the Oracle java XML parser for unix and am trying to
get the test cases to work.
For example, here is one pair of xml/schema files I am having problems
with.

report.xml:
<purchaseReport
  xmlns='/myabsolutepath/report.xsd'
  period="P3M" periodEnding="1999-12-31"
  xmlns:xsi = "http://www.w3.org/1999/XMLSchema-instance">

 <regions>
  <zip code="95819">
   <part number="872-AA" quantity="1"/>
   <part number="926-AA" quantity="1"/>
   <part number="833-AA" quantity="1"/>
   <part number="455-BX" quantity="1"/>
  </zip>
  <zip code="63143">
   <part number="755-KY" quantity="4"/>
  </zip>
 </regions>

 <parts>
  <partSpec number="872-AA">Lawnmower</partSpec>
  <partSpec number="926-AA">Baby Monitor</partSpec>
  <partSpec number="833-AA">Lapis Necklace</partSpec>
  <partSpec number="455-BX">Sturdy Shelves</partSpec>
  <partSpec number="755-KY">Sturdy Shelves</partSpec>
 </parts>

</purchaseReport>


report.xsd:
<schema targetNamespace="/myabsolutepath/report.xsd"
        xmlns="http://www.w3.org/1999/XMLSchema"
        xmlns:r="/myabsolutepath/report.xsd"
        elementFormDefault="qualified">

 <element name="purchaseReport">
  <complexType>
   <element name="regions" type="r:RegionsType"/>
   <element name="parts" type="r:PartsType"/>
   <attribute name="period" type="timeDuration"/>
   <attribute name="periodEnding" type="date"/>
  </complexType>
 </element>

 <complexType name="RegionsType">
  <element name="zip" minOccurs="1" maxOccurs="unbounded">
   <complexType>
    <element name="part" maxOccurs="unbounded">
     <complexType content="empty">
      <attribute name="number" type="r:Sku"/>
      <attribute name="quantity" type="positiveInteger"/>
     </complexType>
    </element>
    <attribute name="code" type="positiveInteger"/>
   </complexType>
  </element>
 </complexType>

 <complexType name="PartsType">
  <element name="partSpec" minOccurs="1" maxOccurs="unbounded">
   <complexType content="textOnly">
     <attribute name="number" type="r:Sku"/>
   </complexType>
  </element>
 </complexType>

<simpleType name="Sku" base="string">
    <pattern value="\d{3}-[A-Z]{2}"/>
</simpleType>

</schema>


Running "java XSDSample report.xml" works just fine. It parses it but
doesn't validate it.
But when I try "java XSDSetSchema report.xsd report.xml" I get the
following error:
java.lang.NullPointerException
        at
oracle.xml.parser.schema.XSDGroup.buildPathTable(XSDGroup.java:318)
        at
oracle.xml.parser.schema.XSDElement.buildPathTable(XSDElement.java:538)
        at
oracle.xml.parser.schema.XSDGroup.buildPathTable(XSDGroup.java:304)
        at
oracle.xml.parser.schema.XSDElement.buildPathTable(XSDElement.java:538)
        at
oracle.xml.parser.schema.XMLSchemaNode.buildSchemaPathTable(XMLSchemaNode.java:96)

        at
oracle.xml.parser.schema.XSDBuilder.buildSchemaPathTable(XSDBuilder.java:269)

        at
oracle.xml.parser.schema.XSDBuilder.build(XSDBuilder.java:226)
        at
oracle.xml.parser.schema.XSDBuilder.build(XSDBuilder.java:206)
        at XSDSetSchema.main(XSDSetSchema.java:26)

I should say I have tried using both java 1.3 and 1.2.2 and both give me
error saying XSDSample
uses or overrides a deprecated API.

Has anybody had success running this or any of the other test programs?
Does anybody know what the problem is?

Another question I have is why are the test cases using
http://www.w3.org/1999/XMLSchema
instead of http://www.w3.org/2000/10/XMLSchema when they are supposed to
handle the newest
version of the schema spec?

Thanks,
Karin

Received on Tuesday, 7 November 2000 11:47:52 UTC