× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi Paul,

That's because IFS files are tagged with a CCSID. When you read an IFS file, you can determine it's CCSID from the "object description"... I'm guessing that the XML Toolkit tries that CCSID in preference to the encoding attribute.

On the other hand, when the data is kept in a variable and passed to the API via parameters, there's no CCSID attribute to go by. So it has to rely on the encoding.

Just a guess, mind you... but it would explain what's happening...

You might consider constructing your XML data in unicode. RPG has excellent support for UCS-2 and UTF-16 Unicode. If you construct your data in Unicode instead of EBCDIC, you theoretically won't have the same problem.

Incidentally, just for the fun of it, I ran your sample XML document (the one with <![CDATA[) through Expat and it worked okay in Expat. Granted, I didn't try changing my job CCSID to a non-37 value, so it probably wasn't a very good test :)



Paul Nicolay wrote:
Scott,
I can understand the bracket issue, but the strange thing is that without the CDATA element, I neither can parse anything apart from those XML's that use encoding ibm037 (while for documents in the IFS the encoding doesn't matter at all, everything works).
Anyway, I'll try once more to get everything in sync related to CCSID possibilities.
Kind regards,
Paul

________________________________

Van: rpg400-l-bounces@xxxxxxxxxxxx namens Scott Klement
Verzonden: vr 5/12/2008 00:08
Aan: RPG programming on the IBM i / System i
Onderwerp: Re: XML Toolkit and CDATA elements



Hi Paul,

Everything you say seems to point at a CCSID problem. The square
bracket [ character is notoriously difficult to deal with in EBCDIC

Since your encoding is set to ibm037 -- please make extra sure that the
CCSID of your RPG source code is CCSID 37. (Which would be odd, since if
I recall correctly, you don't live in a country that uses 37 by default)
If not, make corrections accordingly.






As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.