XSD: Dynamic Record Type
Hi,
I have a file that I am processing using ESB File Adapters. The problem that I have is that the ESB generated XSD file is not up to scratch. A similar representation of the file looks like the one below. If you look at record type 16 (I classify the record type based on the first column of the row), you will notice that the number of column varies for no particular reason. It can have a minimum of 5 and a maximum of 7 columns. The ESB generated XSD file will default to the maximum. The problem at runtime is that if the column only contains five, the next two columns will be populated by the data on the next row.
Can anybody tell me how I should do the XSD representation? I tried using choice, group, minOccurs and nillable but it didn't work.
Sample file:
01,,Y8BG,080801,1200,1,78,78/
02,Y8BG,NATAUS66,1,080731,0000/
03,1095641294525,USD,015,4183475,100,4498,102,100,400/
88,000,402,000,500,000,501,000,502/
16,399,4498,0,INTEREST/
49,4192571,4192571/
98,4192571,1,4192571/
99,4192571,1,10,4192571/
01,,Y8BG,080802,0354,1,78,78/
02,Y8BG,NATAAU3M,1,080801,0000/
03,566977304,AUD,015,707547617-,100,27027646,102,2700,400/
88,33772006,402,3500,500,000,501,000,502/
16,910,18600,0,0/
16,175,100025,0,0/
16,911,4723027,0,0/
16,195,500000,0,0,INTERNET TRANSFER
88,INTERNET TRANSFER Job 10707 5000
16,195,166790,0,0,INTERNET TRANSFER
88,INTERNET TRANSFER DonPrevADEL AV Fortune Events
16,936,19537,0,0,STAGING CONNE
49,4312352,4312352/
98,66672043,5,66672043/
99,-459087506,2,263,-459093026/
snapshot of XSD generated by the ESB.
<xsd:element name="Transaction_detail" nxsd:conditionValue="16">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="C2" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="," nxsd:quotedBy=""">
</xsd:element>
<xsd:element name="C3" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="," nxsd:quotedBy=""">
</xsd:element>
<xsd:element name="C4" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="," nxsd:quotedBy=""">
</xsd:element>
<xsd:element name="C5" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="," nxsd:quotedBy=""">
</xsd:element>
<xsd:element name="C6" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="," nxsd:quotedBy=""">
</xsd:element>
<xsd:element name="C7" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="${eol}" nxsd:quotedBy=""">
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
Cheers,
KR