Merry Christmas!

 

I would like my XML instance file to look like this:

 

<?xml version="1.0" encoding="UTF-8"?>

<ResponseBatch xmlns="http://infor.com/FactsResponseBatch"

   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                           ConsumerKey="1234"

               Language="English"

               DateTime="today"

                     SerialID="0011111">

    <Response xmlns:tns="http://infor.com/FactsCodeData"

                          RequestID="CodeData" SerialID="54321" Company="12">

        <Codes>

                        <Code>

                      <Code>Code Value </Code>

                      <Description>Description Value</Description>

                      <ParentCode>Parent Code Value</ParentCode>

                        </Code>

        </Codes>

              <RestartPoint>abcdefg</RestartPoint>

    </Response>

</ResponseBatch>

 

In other words I want the namespace xmlns:tns="http://infor.com/FactsCodeData" to cover only response elements and its sub-elements.  I want the ResponseBatch top element to have its own name space.  Here is the XSD so far:

 

<?xml version="1.0" encoding="UTF-8"?>

<xs:schema

    targetNamespace="http://infor.com/FactsResponseBatch"

    elementFormDefault="qualified"

    xmlns:rns="http://infor.com/FactsResponseBatch"

    xmlns:tns="http://infor.com/FactsCodeData"

    xmlns:xs="http://www.w3.org/2001/XMLSchema">

 

    <xs:element name="ResponseBatch">

        <xs:complexType>

            <xs:choice maxOccurs="unbounded">

                <xs:element name="Response"    type="tns:Response"/>

            </xs:choice>

                                    <xs:attribute name="ConsumerKey" type="xs:string"/>

                                    <xs:attribute name="Language" type="xs:string"/>

                              <xs:attribute name="DateTime" type="xs:string"/>

                              <xs:attribute name="SerialID" type="xs:string"/>

        </xs:complexType>

    </xs:element>

 

  <xs:complexType name="Response">

        <xs:sequence>

            <xs:element name="Codes" type="tns:Codes"/>

            <xs:element name="RestartPoint" type="xs:string"/>

        </xs:sequence>

            <xs:attribute name="RequestID" type="xs:string"/>

      <xs:attribute name="Company" type="xs:int"/>

      <xs:attribute name="SerialID" type="xs:string"/>

  </xs:complexType>

 

  <xs:complexType name="Codes">

        <xs:sequence>

            <xs:choice maxOccurs="unbounded">

                <xs:element name="Code" type="tns:Code"/>

            </xs:choice>

        </xs:sequence>

  </xs:complexType>

 

  <xs:complexType name="Code">

        <xs:sequence>

            <xs:element name="Code" type="xs:string"/>

            <xs:element name="Description" type="xs:string"/>

            <xs:element name="ParentCode" type="xs:string"/>

        </xs:sequence>

  </xs:complexType>

 

</xs:schema>

 

 

Is this possible with XML Beans? 

 

 

Richard Butterwood | Senior Analyst/Programmer | Infor | office: 770-418-2000 X 1167 | cell: 678-492-3080 | fax: 770-418-2022 | [EMAIL PROTECTED]

 

SAVE THE DATE:
Inforum
Infor Customer Conference
April 9 – 12, 2006
Mandalay Bay Resort & Casino
Las Vegas

 

Reply via email to