Repeating groups in XML not being handled

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
boxtoby
Premium Member
Premium Member
Posts: 138
Joined: Mon Mar 13, 2006 5:11 pm
Location: UK

Repeating groups in XML not being handled

Post by boxtoby »

Hi,

I am using the new xml stage on 9.1 and I am having a problem with repeating groups that look like this:

<c178 m="14">Y</c178>
<c178 m="64">FIRMS</c178>
<c178 m="157">11-25</c178>
<c178 m="158">100K to 500K GBP</c178>
<c178 m="159">N</c178>
<c178 m="160">Y</c178>



I created an xsd file from the data with trang which looks like this (I have removed other normal columns which work fine):

<xs:element name="row">
<xs:complexType>
<xs:sequence>
other cols
xs:element maxOccurs="unbounded" ref="c178"/>
other cols
</xs:sequence>
<xs:attribute name="id" use="required" type="xs:integer"/>
<xs:attribute ref="xml:space" use="required"/>
</xs:complexType>
</xs:element>


<xs:element name="c178">
<xs:complexType mixed="true">
<xs:attribute name="m" use="required" type="xs:integer"/>
</xs:complexType>
</xs:element>



The data stage job which is simply the xml data in a flat file in to the xml stage in to a dataset produces the following error message:

XML_16,0: 2014-07-09 11:35:02,916 Warn [XML_Parser] []
Start XML Validation Errors (Only first error reported for any path in the schema):
Path: [Schema_Node, row, c137]
CDIER0007E: An error occurred while reading input: language=XML, cause=javax.xml.stream.XMLStreamException: Element type "c178" must be followed by either attribute specifications, ">" or "/>"., systemId=null, line number=2, column number=1, step=XML_Parser, source=<row id="10001752" xml:space="preserve"><c1>ETED039</c1><c2>SH10001752</c2><c3>N110001752</c3><c5>S.
End XML Validation Errors

It seems it doesn't understand the <c178 m="nn">data</178> structure.

I believe the cause maybe that the xsd file isn't correct, although I can't find anything online about this type of structure in order to fix it.

Any help would be greatly appreciated.


Cheers,
Bob.
Bob Oxtoby
boxtoby
Premium Member
Premium Member
Posts: 138
Joined: Mon Mar 13, 2006 5:11 pm
Location: UK

Post by boxtoby »

Hi,

I have been able to establish that the xml and xsd is well formed and can be read by third party tools which can recognise the repeating elements.

So it would appear that there is something in the stage which needs to be set or unset to achieve the required result.


Many thanks,
Bob.
Bob Oxtoby
Post Reply