Complex Flat File fixed length in NXSD
Ex:
          20130210                                                            à 
Header  
0001284576196106212013062820130728                  à Details unbounded
0001284578196106212013062820130728
0001284580201210242013060120130604
0001284582193205082013102420141024
0001284584192103222013091420140914
0001302574192610152013092820140928 
1111111111    6                                                            à Trailer  
NXSD Structure
<?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://xmlns.nxsd.madhu/sampleFlatFile"
            targetNamespace=" http://xmlns.nxsd.madhu/sampleFlatFile"
            elementFormDefault="qualified"
            attributeFormDefault="unqualified"
            nxsd:version="NXSD"
            nxsd:stream="chars"
            nxsd:encoding="US-ASCII">
  <xsd:element name="Root-Element">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="Request"
type="tns:RequestType" />
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>
  <xsd:complexType name="DetailsType">
    <xsd:sequence>
      <xsd:element name="empId"
type="xsd:string" minOccurs="0" nxsd:style="fixedLength"
nxsd:length="10" nxsd:padStyle="tail"
nxsd:paddedBy=" " />
      <xsd:element name="DOB"
type="xsd:string" minOccurs="0" nxsd:style="fixedLength"
nxsd:length="8" nxsd:padStyle="tail"
nxsd:paddedBy=" " />
      <xsd:element name="joinDate"
type="xsd:string" minOccurs="0" nxsd:style="fixedLength"
nxsd:length="8" nxsd:padStyle="tail"
nxsd:paddedBy=" " />
      <xsd:element name="joinEndDate"
type="xsd:string" minOccurs="0" nxsd:style="fixedLength"
nxsd:length="8" nxsd:padStyle="tail"
nxsd:paddedBy=" " />
      <xsd:element name="Filler"
type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="${eol}" />
    </xsd:sequence>
  </xsd:complexType>
  <xsd:complexType name="RequestType">
    <xsd:sequence>
      <xsd:element name="Header"
type="tns:HeaderType" minOccurs="0" />
      <xsd:element name="Details"
type="tns:DetailsType" maxOccurs="unbounded"    nxsd:style="array"
nxsd:cellSeparatedBy="" nxsd:arrayTerminatedBy="1111111111"
/>
      <xsd:element name="Trailer"
type="tns:TrailerType" minOccurs="0" />
    </xsd:sequence>
  </xsd:complexType>
  <xsd:complexType name="HeaderType">
    <xsd:sequence>
      <xsd:element name="HeaderID"
type="xsd:string" nxsd:style="fixedLength" nxsd:length="10" />
      <xsd:element name="FileDate"
type="xsd:string" nxsd:style="fixedLength" nxsd:length="8"                       nxsd:padStyle="tail"
nxsd:paddedBy=" " />
 <xsd:element name="HeaderFiller"
type="xsd:string" nxsd:style="terminated"            nxsd:terminatedBy="${eol}" />
    </xsd:sequence>
  </xsd:complexType>
  <xsd:complexType name="TrailerType">
    <xsd:sequence>
      <xsd:element name="TrailerID"
type="xsd:string" nxsd:style="fixedLength" nxsd:length="10" nxsd:padStyle="tail"
nxsd:paddedBy=" " nxsd:prefixWith="1111111111"
/>
      <xsd:element name="TotalEmpRecords"
type="xsd:string" nxsd:style="fixedLength" nxsd:length="8" nxsd:padStyle="tail"
nxsd:paddedBy=" " />
      <xsd:element name="TrailerFiller"
type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="${eol}" />
    </xsd:sequence>
  </xsd:complexType>
</xsd:schema>
    
Happy coding ....!
