From: Spud on
Daniel Pitts wrote:
> Spud wrote:
>> I've got some XML which has apostrophes in the text:
>>
>> <text>O'Brien</text>
>>
>> Technically, it's supposed to encoded as &apos;, but it's not. I don't
>> have control over the input XML.
>>
>> So I parse the incoming XML using SAX, and bizarrely SAX converts the
>> apostrophes to &apos; on its own at parse time. The SAX method:
>>
>> public void characters(char[] ch, int start, int length) throws
>> SAXException {}
>>
>> gets called by the SAX parser with the characters "O&apos;Brien".
>>
>> This seems backwards to me. The SAX parser should be *decoding*
>> character entities, not encoding them.
>>
>> Question: how do I stop this behavior?
>>
>> I'm using the SAX implementation built into JDK 1.5. I can't seem to
>> find any details on the implementation, including how to set options.

> Perhaps an SSCCE would help us help you. I would be surprised if what
> you say is true.
>

You are correct. It was an error in my code. Never mind.

SSCCEs have a way of flushing these things out.
From: Mike Schilling on
Spud wrote:
>
> You are correct. It was an error in my code. Never mind.
>
> SSCCEs have a way of flushing these things out.

That is more than half their value.