|
I found the problem. The sample RPGLE program CREATEDOC & CREATEXML that comes with XML4PR310 has a little bug, in the sense that it puts a new carriage return after each tag. There should be a new line only after the end tag and not after the start tag. When I removed this, the read back and parser worked. Thanks, Sudha -----Original Message----- From: Ramanujan, Sudha Sent: Tuesday, March 04, 2003 11:24 AM To: midrange-l@xxxxxxxxxxxx Subject: XML - Child Node value not retrieved correctly I am trying to read an XML document into an ile rpg. I am getting all the information correctly as far as the tag elements are concerned. But when I come to the value portion, I get 1st char as garbage. My code is as follows: IF child = Qxml_HASCHILD * Get the pointer if there is a child node EVAL ChlNodLst@ = QxmlDOM_Node_getChildNodes(NodLstPtr@) EVAL Nodeptr@ = QxmlDOM_Node_getFirstChild (NodLstPtr@) * Get the value of the child node EVAL Domstrptr@ = QxmlDOM_Node_getNodeValue (Nodeptr@) EVAL childVal = %str( QxmlDOMString_transcode(Domstrptr@)) I think the DomStrprt@ is incorrect for some reason. My xml document looks something like this: <?xml version="1.0" ?> - <Price> <Currency1>USD</Currency2> <Currency2>GBP</Currency2> </Price> The value of Currency1 element comes as '#USD' when moved to my field I get '#US'. In case of numeric field, this throws a decimal data error of course. Can you tell me what I am doing wrong here? TIA, Sudha Sudha Ramanujan SunGard Futures Systems sramanujan@xxxxxxxxxxxxxxxxxx (312) 577 6179 (312) 577 6101 - Fax _______________________________________________ This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/midrange-l or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.