2

I'm using Jdeveloper 12c. I'm trying to use a complexType as a reference to type another element in another complexType. Jdev tells me it cannot find the AddressInfo reference. Here's a snippet of the code that's pertinent, please help:

<?xml version="1.0" encoding="UTF-8"?>
<schema attributeFormDefault="unqualified"
elementFormDefault="qualified"
targetNamespace="http://xmlns.oracle.com/SquareEdge/SEPPO/ProcessPO"
xmlns="http://www.w3.org/2001/XMLSchema">
<complexType name="AddressInfo">
   <sequence>
       <element type="string" name="FirstName"/>
       <element type="string" name="LastName"/>
       <element type="string" name="Street"/>
       <element type="string" name="City"/>
       <element type="string" name="State"/>
       <element type="short" name="ZipCode"/>
       <element type="unsignedLong" name="PhoneNumber"/>
   </sequence>
</complexType>
<complexType name="Billing">
   <sequence>
     <element name="PaymentCardName" type="string" maxOccurs="1"/>
     <element name="PaymentCardNumber" type="unsignedLong"maxOccurs="1"/>
     <element name="ExpirationDate" type="unsignedShort" maxOccurs="1"/>
     <element name="BillingAddress" maxOccurs="1" type="AddressInfo"/> 
   </sequence>
</complexType>
kjhughes
  • 106,133
  • 27
  • 181
  • 240

1 Answers1

5

Define a namespace prefix for the targetNamespace:

  xmlns:po="http://xmlns.oracle.com/SquareEdge/SEPPO/ProcessPO"

then use it to reference AddressInfo:

  <element name="BillingAddress" maxOccurs="1" type="po:AddressInfo"/> 

and your error will be gone.

Altogether (plus some other minor fixes):

<?xml version="1.0" encoding="UTF-8"?>
<schema attributeFormDefault="unqualified"
        elementFormDefault="qualified"
        xmlns:po="http://xmlns.oracle.com/SquareEdge/SEPPO/ProcessPO"
        targetNamespace="http://xmlns.oracle.com/SquareEdge/SEPPO/ProcessPO"
        xmlns="http://www.w3.org/2001/XMLSchema">
  <complexType name="AddressInfo">
    <sequence>
      <element type="string" name="FirstName"/>
      <element type="string" name="LastName"/>
      <element type="string" name="Street"/>
      <element type="string" name="City"/>
      <element type="string" name="State"/>
      <element type="short" name="ZipCode"/>
      <element type="unsignedLong" name="PhoneNumber"/>
    </sequence>
  </complexType>
  <complexType name="Billing">
    <sequence>
      <element name="PaymentCardName" type="string" maxOccurs="1"/>
      <element name="PaymentCardNumber" type="unsignedLong" maxOccurs="1"/>
      <element name="ExpirationDate" type="unsignedShort" maxOccurs="1"/>
      <element name="BillingAddress" maxOccurs="1" type="po:AddressInfo"/> 
    </sequence>
  </complexType>
</schema>
kjhughes
  • 106,133
  • 27
  • 181
  • 240