× 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.



Sounds to me like you are handling the XML_CHARS event, but not handling the XML_UCS2_REF, XML_PREDEF_REF or XML_UNKNOWN_REF events.

If you were handling those events properly, the parser wouldn't "freak" (which I doubt it's doing, anyway) and you wouldn't have to do any special "manipulating" of the data.

Remember, refs like & are a normal part of XML. They shouldn't require any special processing on your part!


On 2/26/2013 1:14 PM, rick baird wrote:
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 &amp; 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


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.