3 Replies Latest reply on May 15, 2018 6:01 AM by Martien van den Akker

    How to generate XSD for Fixed length position file Oracle SOA

    3531344

      Hi,

       

      Need help on XSD Generation.I have to write .txt file with Fixed length position. Can we generate XSD using Native format builder ?

      If anyone have sample xsd's for Fixed length position file ,Please let me know.

       

       

      Thanks,'

        • 1. Re: How to generate XSD for Fixed length position file Oracle SOA
          Martien van den Akker

          Hi,

          If you define an adapter (file, ftp, aq) then you get to click on the 'define native format' button: https://docs.oracle.com/cd/E23943_01/integration.1111/e10231/nfb.htm#TKADP856 . Then choose 'Fixed Length' and follow the wizard. See also given link to the doc.

          It's pretty straight forward. Have you tried this? And if so where did you get stuck?

           

          Regards,

          Martien

          • 2. Re: How to generate XSD for Fixed length position file Oracle SOA
            3531344

            I have created XSD through Native format Builder,Can you please check this ? is this one valid XSD ?

            Please find the Below Sample Data

             

            Sample Data:

            111asdadfasdasdas

            000 sdsada  dsadasd s

            001 fsddsad sdasdasd

            002 dasdasd  asdasdas

            000 asdasdas adsasdasd

            001 adssad adsadas

            002 asdasd assdfff

             

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

            <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"

                        xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd"

                        xmlns:tns="http://www.oracle.com/FTPAdapter"

                        targetNamespace="http://www.oracle.com/FTPAdapter"

                        elementFormDefault="qualified"

                        attributeFormDefault="unqualified"

                        nxsd:version="NXSD"

                        nxsd:stream="chars"

                        nxsd:encoding="US-ASCII"

            >

              <xsd:element name="Invoices">

                <xsd:complexType>

                  <xsd:choice minOccurs="1" maxOccurs="unbounded" nxsd:choiceCondition="fixedLength" nxsd:length="3">

                    <xsd:element name="RECORD1" nxsd:style="array" nxsd:cellSeparatedBy="${eol}" nxsd:conditionValue="998">

                      <xsd:complexType>

                        <xsd:sequence>

                          <xsd:element name="C2" type="xsd:string" nxsd:style="fixedLength" nxsd:length="10" />

                          <xsd:element name="C3" type="xsd:string" nxsd:style="fixedLength" nxsd:length="10" />

                          <xsd:element name="C4" type="xsd:string" nxsd:style="fixedLength" nxsd:length="10" />

                        </xsd:sequence>

                      </xsd:complexType>

                    </xsd:element>

                    <xsd:element name="RECORD2" nxsd:style="array" nxsd:cellSeparatedBy="${eol}" nxsd:conditionValue="000">

                      <xsd:complexType>

                        <xsd:sequence>

                          <xsd:element name="C2" type="xsd:string" nxsd:style="fixedLength" nxsd:length="30" />

                          <xsd:element name="C3" type="xsd:string" nxsd:style="fixedLength" nxsd:length="30" />

                          <xsd:element name="C4" type="xsd:string" nxsd:style="fixedLength" nxsd:length="10" />

                          <xsd:element name="C5" type="xsd:string" nxsd:style="fixedLength" nxsd:length="30" />

                          <xsd:element name="C6" type="xsd:string" nxsd:style="fixedLength" nxsd:length="10" />

                          <xsd:element name="C7" type="xsd:string" nxsd:style="fixedLength" nxsd:length="3" />

                          <xsd:element name="C8" type="xsd:decimal" nxsd:style="fixedLength" nxsd:length="28" />

                          <xsd:element name="C9" type="xsd:string" nxsd:style="fixedLength" nxsd:length="5" />

                          <xsd:element name="C10" type="xsd:string" nxsd:style="fixedLength" nxsd:length="254" />

                          <xsd:element name="C11" type="xsd:string" nxsd:style="fixedLength" nxsd:length="30" />

                          <xsd:element name="C12" type="xsd:string" nxsd:style="fixedLength" nxsd:length="22" />

                          <xsd:element name="C13" type="xsd:string" nxsd:style="fixedLength" nxsd:length="30" />

                          <xsd:element name="C14" type="xsd:string" nxsd:style="fixedLength" nxsd:length="4" />

                          <xsd:element name="C15" type="xsd:string" nxsd:style="fixedLength" nxsd:length="10" />

                          <xsd:element name="C16" type="xsd:decimal" nxsd:style="fixedLength" nxsd:length="33" />

                          <xsd:element name="C17" type="xsd:string" nxsd:style="fixedLength" nxsd:length="20" />

                          <xsd:element name="C18" type="xsd:string" nxsd:style="fixedLength" nxsd:length="5" />

                          <xsd:element name="C19" type="xsd:decimal" nxsd:style="fixedLength" nxsd:length="33" />

                          <xsd:element name="C20" type="xsd:decimal" nxsd:style="fixedLength" nxsd:length="33" />

                          <xsd:element name="C21" type="xsd:decimal" nxsd:style="fixedLength" nxsd:length="28" />

                          <xsd:element name="C22" type="xsd:decimal" nxsd:style="fixedLength" nxsd:length="28" />

                          <xsd:element name="C23" type="xsd:string" nxsd:style="fixedLength" nxsd:length="3" />

                          <xsd:element name="C24" type="xsd:string" nxsd:style="fixedLength" nxsd:length="28" />

                          <xsd:element name="C25" type="xsd:string" nxsd:style="fixedLength" nxsd:length="1" />

                          <xsd:element name="C26" type="xsd:string" nxsd:style="fixedLength" nxsd:length="10" />

                        </xsd:sequence>

                      </xsd:complexType>

                    </xsd:element>

                    <xsd:element name="RECORD3" nxsd:style="array" nxsd:cellSeparatedBy="${eol}" nxsd:conditionValue="001">

                      <xsd:complexType>

                        <xsd:sequence>

                          <xsd:element name="C2" type="xsd:string" nxsd:style="fixedLength" nxsd:length="30" />

                          <xsd:element name="C3" type="xsd:decimal" nxsd:style="fixedLength" nxsd:length="28" />

                          <xsd:element name="C4" type="xsd:string" nxsd:style="fixedLength" nxsd:length="17" />

                          <xsd:element name="C5" type="xsd:string" nxsd:style="fixedLength" nxsd:length="3" />

                          <xsd:element name="C6" type="xsd:decimal" nxsd:style="fixedLength" nxsd:length="17" />

                          <xsd:element name="C7" type="xsd:string" nxsd:style="fixedLength" nxsd:length="10" />

                          <xsd:element name="C8" type="xsd:string" nxsd:style="fixedLength" nxsd:length="30" />

                          <xsd:element name="C9" type="xsd:string" nxsd:style="fixedLength" nxsd:length="50" />

                          <xsd:element name="C10" type="xsd:string" nxsd:style="fixedLength" nxsd:length="30" />

                          <xsd:element name="C11" type="xsd:string" nxsd:style="fixedLength" nxsd:length="183" />

                        </xsd:sequence>

                      </xsd:complexType>

                    </xsd:element>

                    <xsd:element name="RECORD4" nxsd:style="array" nxsd:cellSeparatedBy="${eol}" nxsd:conditionValue="002">

                      <xsd:complexType>

                        <xsd:sequence>

                          <xsd:element name="C2" type="xsd:string" nxsd:style="fixedLength" nxsd:length="30" />

                          <xsd:element name="C3" type="xsd:string" nxsd:style="fixedLength" nxsd:length="220" />

                          <xsd:element name="C4" type="xsd:string" nxsd:style="fixedLength" nxsd:length="47" />

                          <xsd:element name="C5" type="xsd:decimal" nxsd:style="fixedLength" nxsd:length="28" />

                          <xsd:element name="C6" type="xsd:string" nxsd:style="fixedLength" nxsd:length="30" />

                          <xsd:element name="C7" type="xsd:string" nxsd:style="fixedLength" nxsd:length="10" />

                          <xsd:element name="C8" type="xsd:string" nxsd:style="fixedLength" nxsd:length="6" />

                          <xsd:element name="C9" type="xsd:string" nxsd:style="fixedLength" nxsd:length="10" />

                          <xsd:element name="C10" type="xsd:string" nxsd:style="fixedLength" nxsd:length="10" />

                          <xsd:element name="C11" type="xsd:string" nxsd:style="fixedLength" nxsd:length="10" />

                        </xsd:sequence>

                      </xsd:complexType>

                    </xsd:element>

                  </xsd:choice>

                </xsd:complexType>

              </xsd:element>

            </xsd:schema>

            • 3. Re: How to generate XSD for Fixed length position file Oracle SOA
              Martien van den Akker

              Hi,

               

              It seems alright semantically. But it does not match your example file.

              The RECORD1 does have 3 columns, but with fixed length of 10. While your example rows have different lengths.

               

              And notice that you can change the names of the records and columns. That would provide a more readable and sensible xml.

               

              Regards,

              Martien