Rick,
Look at the section entitled "Predefined entities in XML" at the following URL:
http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references
Those are the special reserved characters you must escape or use within CDATA tags.
Matt
-----Original Message-----
From: rick baird [mailto:rick.baird@xxxxxxxxx]
Sent: Tuesday, February 26, 2013 1:15 PM
To: Midrange Systems Technical Discussion
Subject: XML parsing in RPG.
hey all,
I'm working on a program to parse XML using the "new" XML-SAX handlers and have a question.
I did not write the program, so I'm kind of working backwards here - I don't fully understand the XML operations - trying to learn as I go, but I'm sure others must have run across this problem and can give me an idea of where to look to fix it.
the program works just fine 99.9% of the time, but one of the data elements comes through with replacement characters for an ampersand '&' - i.e. &
the parser sees this and freaks, losing all the characters before and including that string, making the value whatever is after the ampersand.
basically, it interprets this:
the value is supposed to be: 'TRAVELERS CASUALTY & SURETY CO. OF AMERICA'
which comes in from the 3rd party (after ebcdic translation) as:
<value xsi:type="soapenc:string">TRAVELERS CASUALTY & SURETY CO. OF AMERICA</value> when the parser is done with it, it looks like this:
' SURETY CO. OF AMERICA'
I can manipulate the characters any way I want, but is '&' the only character that gets treated this way? are there other &xxxx; replacement variables for other characters?
I feel like I'm fishing without a worm here. I don't want to read every XML link on infocenter or elsewhere searching for something that should be simple.
thanks in advance!
Rick
--
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.