SAS Data Integration Studio, DataFlux Data Management Studio, SAS/ACCESS, SAS Data Loader for Hadoop and others

Create XML using XSD

Reply
Occasional Contributor
Posts: 6

Create XML using XSD

Hi All,

I have an urgent requirement to create an XML using a complex XSD using SAS DI 4.2. This XML created has sub elements

within it which is recurring on a 1 to many basis. If anyone has any such experience in your experience with SAS DI, please

let me know.

For reference i am pasting the XSD here and these are the mapping details between ADetail & CDetail.

1) 1 to 1 mapping

2) 1 to many mapping

3) 1 to Zero mapping.

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

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" id="Microsites">

<xs:element name="Upload">

  <xs:complexType>

   <xs:sequence>

    <xs:element name="Entry" maxOccurs="unbounded">

     <xs:complexType>

      <xs:sequence>

       <xs:element name="ABC" type="xs:integer" minOccurs="1"/>

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

       <xs:element name="123" type="xs:string" minOccurs="0"/>

       <xs:element name="445" type="xs:string" minOccurs="0"/>

       <xs:element name="ADetail" minOccurs="0" maxOccurs="unbounded">

        <xs:complexType>

         <xs:sequence>

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

          <xs:element name="LMN" type="xs:string" minOccurs="0"/>

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

          <xs:element name="CDetail" minOccurs="0" maxOccurs="unbounded">

           <xs:complexType>

            <xs:sequence>

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

             <xs:element name="SDA" type="xs:decimal"/>

             <xs:element name="FSA" type="xs:decimal" minOccurs="0"/>

             <xs:element name="SAS" type="xs:date" minOccurs="0"/>

            </xs:sequence>

           </xs:complexType>

          </xs:element>

         </xs:sequence>

        </xs:complexType>

       </xs:element>

      </xs:sequence>

     </xs:complexType>

    </xs:element>

   </xs:sequence>

  </xs:complexType>

</xs:element>

</xs:schema>

Ask a Question
Discussion stats
  • 0 replies
  • 278 views
  • 0 likes
  • 1 in conversation