Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

maxOccurs="unbounded" is not working for NXSD files.

User_TNWX6Mar 14 2011 — edited Mar 15 2011
Hi,

I am using the below XSD structure to read fixed length files. The fixed length files can have mutliple occurrences of a bunch of lines. For e.g.,

1 A 0010CTCTL 09834
1 A 0020A1TH1 09089
1 A 0030A2TH2 98765
1 A 0010CTCTL 1233
1 A 0020A1TH1 0908
1 A 0030A2TH2 98762

the bunch of CTCTL, A1TH1, A2TH2 can repeat multiple times in the fixed length input files. To achieve this I am using the below structure in my XSD.

<xsd:element name="CreatePurchaseOrder">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="PurchaseOrder" type="crtpoout:PurchaseOrderType" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>

<xsd:complexType name="PurchaseOrderType">
<xsd:sequence>
<xsd:element name="CTCTL_0010" minOccurs="0" maxOccurs="1" nxsd:lookAhead="95" nxsd:lookFor="CTCTL">
<xsd:complexType>
<xsd:sequence>
.................... few more elements .................
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="A1TH1_0020" minOccurs="0" maxOccurs="1" nxsd:lookAhead="95" nxsd:lookFor="A1TH1">
<xsd:complexType>
<xsd:sequence>
.................... few more elements .................
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="A2TH2_0030" minOccurs="0" maxOccurs="1" nxsd:lookAhead="95" nxsd:lookFor="A2TH2">
<xsd:complexType>
<xsd:sequence>
.................... few more elements .................
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>


When I use the above xsd, the input file is not being read and there is no translation exception also. But, when I use

<xsd:element name="PurchaseOrder" type="crtpoout:PurchaseOrderType" minOccurs="0" maxOccurs="1"/>, the input file is being read, but only the first bunch of lines.

Please let me know if there is any issue in the above xsd for reading all the lines or is there any alternative to achieve this?

Thanks,
-Sriharish.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 12 2011
Added on Mar 14 2011
1 comment
512 views