Hi Mike,
I use the XML-SAX op-code where there is an array dimension telling the parser how many levels there are in the XML document.Is there something similar you need to set with the XML-INTO.
R,Mark.
On Tuesday, 25 April 2017, 18:25, "Smith, Mike" <Mike_Smith@xxxxxxxxxxxxxxxx> wrote:
I'm trying to process an XML file. I am struggling trying to get it loaded via XML-INTO.
I can get the first channel element to load but nothing after that.
Any idea what I've got wrong.
Sample from File
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<!---->
<!--Itron FCS Generated: 4/21/2017 9:15:49 AM LT-->
<!---->
<MeterReadingDocument xmlns:xsd="
http://www.w3.org/2001/XMLSchema" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance">
<ImportExportParameters CreateResubmitFile="false">
<DataFormat DSTTransitionType="ITRON_Compliant" ReadingTimestampType="Utc" />
</ImportExportParameters>
<Channels>
<Channel ReadingsInPulse="false" IsRegister="true" IsReadingDecoded="false" MarketType="Gas">
<ChannelID EndPointChannelID="32842936:1" />
<Readings>
<Reading Value="0009290249" ReadingTime="2017-03-31T13:44:46" />
</Readings>
<OptionalChannelDatas>
<OptionalChannelData Name="ERTType" Value="2" />
<OptionalChannelData Name="Tamper1" Value="0" />
<OptionalChannelData Name="Tamper2" Value="2" />
</OptionalChannelDatas>
</Channel>
<Channel ReadingsInPulse="false" IsRegister="true" IsReadingDecoded="false" MarketType="Gas">
<ChannelID EndPointChannelID="41409881:1" />
<Readings>
<Reading Value="0000281274" ReadingTime="2017-04-18T11:51:00" />
</Readings>
<OptionalChannelDatas>
<OptionalChannelData Name="ERTType" Value="12" />
<OptionalChannelData Name="Tamper1" Value="0" />
<OptionalChannelData Name="Tamper2" Value="0" />
</OptionalChannelDatas>
</Channel>
</Channels>
</MeterReadingDocument>
What I currently have for data structures
D Channels DS Qualified Dim(99999)
D Channel LikeDS(Channel)
D ChannelID LikeDS(Channelid)
D Readings LikeDS(Readings)
D Channel DS Template
D readingsinpulse...
D 5a
D isregister 5a
D isreadingdecoded...
D 5a
D markettype 5a
D
D Channelid DS Template
D endpointchannelid...
D 10a
D Readings DS Template
D readingvalue 10a
D readingtime 20a
XML-INTO Channels
%XML(XMLFile: 'doc=file +
datasubf=data +
countprefix=count +
case=any');
NOTICE: This message, including any attachment, is intended as a confidential and privileged communication. If you have received this message in error, or are not the named recipient(s), please immediately notify the sender and delete this message.
As an Amazon Associate we earn from qualifying purchases.