This is an example from iseries 400 Experts Journal..
which if your not a subscriber I would recommend
best iseries publication out there... IMHO
I just started messing with it....
From Susan Gantner
Kinda cool so far didnt think it was this easy...
now this is a simple example using just a datastructure.
I will try to use a procedure next.... requires the %Handler BIF
anyway......This is working(V5R4) I'm trying to change the
XML so that there are multiple shipto's:
so
Just not sure how to do this. I have added another qualified
datastructure with dimensions...but I just cant make it work.
It compiles but fails on the load.
Anyway if anyone has any ideas please post away!
The XML document and named xml.xml
this is placed in folder /jamie which is located under
the /root
Any help is appreciated... (this version btw works fine)
as long as there arent 101 customers coming down
The code
which if your not a subscriber I would recommend
best iseries publication out there... IMHO
I just started messing with it....
From Susan Gantner
Kinda cool so far didnt think it was this easy...
now this is a simple example using just a datastructure.
I will try to use a procedure next.... requires the %Handler BIF
anyway......This is working(V5R4) I'm trying to change the
XML so that there are multiple shipto's:
so
PHP Code:
<shiptos>
<shipto></shipto>
<shipto></shipto>
<shipto></shipto>
</shiptos>
datastructure with dimensions...but I just cant make it work.
It compiles but fails on the load.
Anyway if anyone has any ideas please post away!
The XML document and named xml.xml
this is placed in folder /jamie which is located under
the /root
Any help is appreciated... (this version btw works fine)
as long as there arent 101 customers coming down
PHP Code:
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
<Customers>
<Customer ID = "12345">
<Contact>Bill Buckram</Contact>
<Company>Pirate Steel Corporation</Company>
<Address>
<Street>1234 Jones St.</Street>
<City>Anytown</City>
<State>IL</State>
<zip>61254</zip>
</Address>
<shipto ID = "1">
<Street>12 West pizza drive</Street>
<City>BoysTown</City>
<State>IL</State>
<zip>61258</zip>
</shipto>
</Customer>
<Customer ID = "67890">
<Contact>Joe Smoker</Contact>
<Company>Tobacco Sales and Service</Company>
<Address>
<Street>5454 Smith Street.</Street>
<City>Mytown</City>
<State>IL</State>
<zip>61548</zip>
</Address>
<shipto ID = "1">
<Street>333 mark avenue</Street>
<City>DevilsVille</City>
<State>WI</State>
<zip>58458</zip>
</shipto>
</Customer>
</Customers>
Code:
// // Variable Definition // d cmdstring s 512 d cmdlength s 15 5 d ISodate s d d customer ds Qualified dim(100) d ID 5 0 d contact 30A d Company 30A d Address likeds(Address) d Shipto likeds(Shipto) d Address ds Qualified d street 40 d city 30A d state 2A d zip 10a d shipto ds Qualified d ID 5 0 d street 40 d city 30A d state 2A d zip 10a d $command pr extpgm('QCMDEXC') d command 5000 options(*varsize) d Length 15 5 /Free //-------------------------------------------------------- // MAIN PROGRAM //-------------------------------------------------------- XML-Into Customer %XML('/jamie/xml.xml' : 'case=any ' + ' doc=file path=Customers/Customer' + ' allowmissing=yes'); *inlr = *on; /End-Free
Comment