Scratch that. Not case-sesitive? Are you getting any errors, from the
XML-INTO?
Try flip your slashes..
Inz('/QNTC/HPIA/g/SteveTest.xml')
to
Inz('\QNTC\HPIA\g\SteveTest.xml')
David L. Mosley, Jr.
Technical Solutions Architect
Dancik International, Ltd.
2000 CentreGreen Way, Suite 250
Cary, NC 27513
www.dancik.com
sjones@xxxxxxxxxxxxxx
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
11/23/2010 11:05 AM
Please respond to
RPG programming on the IBM i / System i <rpg400-l@xxxxxxxxxxxx>
To
rpg400-l@xxxxxxxxxxxx
cc
Subject
XML help
This is my first attempt at reading xml using RPG & I am missing
something. Below is some of the xml document, not the entire file, & my
program that I am trying to display for now the values. It displays
blanks for both fields.
Being the first time we have ever used XML it seems pretty straight
forward, but we are confused why this not displaying the values. Once we
figure out this simple part, then we have to wrap our heads around tags
that repeat....
Thanks in advance
Steve
- <BODS xmlns="
http://www.xxxx">
- <BOD>
- <PurchaseOrder>
- <PurchaseOrderHeader>
<DocumentPurposeCode>00</DocumentPurposeCode>
- <DocumentID>
<ID>100932360</ID>
</DocumentID>
</PurchaseOrder>
</BOD>
</BODS>
d PurchaseOrder ds Qualified
d PurchaseOrderHeader...
d LikeDS(PurchaseOrderHeader_t)
d PurchaseOrderHeader_t...
d ds Qualified
d based(Template)
d DocumentPurposeCode...
d 2a
d DocumentID LikeDS(DocumentID_t)
d DocumentID_t ds Qualified
d based(Template)
d ID 10a
d XML_Source S 256a Varying
d
Inz('/QNTC/HPIA/g/SteveTest.xml')
D Options s 100a varying
/Free
Options = 'doc=file +
Path=BODS/BOD +
case=any +
allowextra=yes +
allowmissing=yes';
XML-INTO PurchaseOrder %XML(XML_Source: Options);
dsply PurchaseOrder.PurchaseOrderHeader.DocumentPurposeCode;
dsply PurchaseOrder.PurchaseOrderHeader.DocumentID.ID;
*inlr = *on;
/End-Free
As an Amazon Associate we earn from qualifying purchases.