From: Spud on 3 Sep 2009 19:31 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 ', 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 ' 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'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 3 Sep 2009 20:20 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.
First
|
Prev
|
Pages: 1 2 Prev: Cryptography Next: Don't feed the troll (Was: Synchronization Question) |