[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: http_parse_xml_string usage
Mike,
Thank you very much - your example and Scott's worked fine.
Turns out you can pass 0 or 37 as the CCSID parm - both work.
My REAL problem, after looking at both of your examples, was that my xml
string was stored in a varchar and I guess the parser was picking up the
length portion rather than the opening "<". Duh.
Human, all too human.
-----Original Message-----
From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
[mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Mike Krebs
Sent: Thursday, October 30, 2008 1:42 PM
To: 'HTTPAPI and FTPAPI Projects'
Subject: RE: http_parse_xml_string usage
Hi Scott,
You're getting frustrated? Maybe you are picking that up from us humans!
Rick, since it was lunchtime, I took the opportunity to try something.
This
seems to work. Maybe you can use it to get your project working.
Mike Krebs
H DFTACTGRP(*NO) BNDDIR('HTTPAPI')
D xmlData s 25a
D CCSID s 10i 0 inz(37)
D rc s 10i 0
D Order s 10I 0
/copy qrpglesrc,httpapi_h
D Incoming PR
D userdata * value
D depth 10I 0 value
D name 1024A varying const
D path 24576A varying const
D value 65535A varying const
D Attrs * dim(32767)
D const options(*varsize)
/FREE
XMLData = '<OrderID>123</OrderID>';
rc = http_parse_xml_string(%addr(XMLData)
: %len(%trim(XMLData))
: CCSID
: *null
: %paddr(Incoming)
: *null);
dsply Order;
*inlr = *on;
/end-free
P Incoming B
D Incoming PI
D userdata * value
D depth 10I 0 value
D name 1024A varying const
D path 24576A varying const
D value 65535A varying const
D attrs * dim(32767)
D const options(*varsize)
/free
select;
when name = 'OrderID';
Order = %dec(value : 6: 0);
endsl;
return;
/end-free
P E
-----Original Message-----
From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
[mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Scott
Klement
Sent: Thursday, October 30, 2008 11:37 AM
To: HTTPAPI and FTPAPI Projects
Subject: Re: http_parse_xml_string usage
Mike,
Converting it to ASCII is completely unnecessary.
I'm REALLY getting frustrated. Can you tell me where I'm going wrong in
my explanation? I thought I had explained it in detail, but somehow
both you and Rick misunderstood me.
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------