Article

Error 13054 when using READ-XML into an empty dynamic ProDataset

Information

 
Article Number000064506
EnvironmentOpenEdge-4GL Development System-AIX-7.1 TL 3
Question/Problem Description
When reading an XML file which has a structure similar to the one shown below into an undefined dynamic ProDataset, error 13054 is generated:
 
<?xml version="1.0" encoding="UTF-8"?>
<SomeElement xmlns="http://www.nrf-arts.org/IXRetail/namespace">
	<Child Target="ABC" Recipient="Customer">
		<TextLine>AAA</TextLine>
		<TextLine>BBB</TextLine>
		<TextLine>CCC</TextLine>
		<TextLine>DDD</TextLine>
		<TextLine>EEE</TextLine>
	</Child>
	<Child Target="DEF" Recipient="Store">
		<TextLine>AAA</TextLine>
		<TextLine>BBB</TextLine>
		<TextLine>CCC</TextLine>
		<TextLine>DDD</TextLine>
		<TextLine>EEE</TextLine>
		<TextLine>FFF</TextLine>
		<TextLine>GGG</TextLine>
	</Child>
</SomeElement>


 
Steps to Reproduce
Clarifying Information
Error MessageInvalid number of array elements for field '<field>' in table '<table>'. (13054)
Defect/Enhancement Number
Cause
The XML defines two temp-table records for the Child element.  These records define a different number of elements for <TextLine>. When READ-XML tries to infer a schema from data it uses the first <Child> element. The number of extents defined for <TextLine> is based upon the number shown in the first <Child> element.  When READ-XML tries to process the second <Child> element the size of the TextField array (extent size) is insufficient to contain all of the data and error 13054 is generated.
Resolution
Generate an XML Schema (XSD) file by using the WRITE-XMLSCHEMA method against the dynamic ProDataset after the 13054 error is generated. This will give you the schema that READ-XML inferred from the XML. Modify this file to set the MinOccurs and MaxOccurs attributes of the <TextLine> element to a size that can handle the maximum number of <TextLine> elements that will ever happen then modify the application code to use the READ-XMLSCHEMA method against the empty dynamic ProDataset to load this schema before doing the READ-XML method call.
 
Workaround
Notes
Attachment 
Last Modified Date11/12/2015 2:15 PM


Feedback
 
Did this article resolve your question/issue?

   

Your feedback is appreciated.

Please tell us how we can make this article more useful. Please provide us a way to contact you, should we need clarification on the feedback provided or if you need further assistance.

Characters Remaining: 1025