How to produce xsd for multiple record with header
akdasariMar 26 2013 — edited Feb 26 2020Hi
I tried with native format builder but that's of no use for me
I have a flat file like this
0+022+
1+012+
2+022+
2+032+
1+021+
2+025+
5+036+
I need a schema for repeating records. My record starts for each 0 and ends for 5
0=header 1=page 2=word 5=end
Can somebody help me please.
for now I have this schema but I get more number of xml elements than the data when I transform in bpel
Also When i parse, as my records end with + {eol}, I get + at the end of the last element, how to get rid of that
<?xml version="1.0" encoding="US-ASCII"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd"
xmlns:tns="http://www.oracle.com/ias/processconnect"
targetNamespace="http://www.oracle.com/ias/processconnect"
elementFormDefault="qualified" attributeFormDefault="unqualified"
nxsd:stream="chars" nxsd:version="NXSD" nxsd:validateNxsd="true">
<element name="PFW16">
<complexType>
<sequence>
<element ref="tns:Header" nxsd:conditionValue="0"/>
<element ref="tns:Pager" nxsd:conditionValue="1" maxOccurs="unbounded"/>
<element ref="tns:Tail" nxsd:conditionValue="5" />
</sequence>
</complexType>
</element>
<!--Header Record -->
<element name="Header" type="tns:HeaderType"/>
<complexType name="HeaderType">
<sequence>
<element name="RecordTypeIndicator" type="string"
nxsd:style="terminated" nxsd:terminatedBy="+"/>
<element name="VersionNumber" type="string"
nxsd:style="terminated" nxsd:terminatedBy="${eol}"/>
</sequence>
</complexType>
<!-- Pager Record -->
<element name="Pager" type="tns:PagerRecordType"/>
<complexType name="PagerRecordType">
<sequence>
<element name="RecordTypeIndicator" type="int"
nxsd:style="terminated" nxsd:terminatedBy="+"/>
<element name="VersionNumber" type="string"
nxsd:style="terminated" nxsd:terminatedBy="${eol}"/>
<element name="words">
<complexType>
<sequence>
<element name="Detail-Item" minOccurs="1"
maxOccurs="unbounded">
<complexType>
<group ref="tns:WordsRecord"
nxsd:conditionValue="2"/>
</complexType>
</element>
</sequence>
</complexType>
</element>
</sequence>
</complexType>
<group name="WordsRecord">
<sequence>
<element name="RecordTypeIndicator" type="int"
nxsd:style="terminated" nxsd:terminatedBy="+"/>
<element name="VersionNumber" type="string"
nxsd:style="terminated" nxsd:terminatedBy="${eol}"/>
</sequence>
</group>
<element name="Tail" type="tns:EndType"/>
<complexType name="EndType">
<sequence>
<element name="RecordTypeIndicator" type="string"
nxsd:style="terminated" nxsd:terminatedBy="+"/>
<element name="VersionNumber" type="string"
nxsd:style="terminated" nxsd:terminatedBy="${eol}"/>
</sequence>
</complexType>
</schema>