I have made a class XmlHandler that extends DefaultHandler and reads XML. The XML contains the following tag.
<description>"like" us on facebook</description>
Without quotes its easy to grab the value using the characters method and put it in an object. With quotes surrounding like however I’m having a problem. The characters method does not receive the full description with one call, but characters is called 4 times, each time receiving only part of the description.
Is there a way to format the xml, so it can be read correctly by DefaultHandler or do I have to add some logic to account for the existence of quotes?
Found the problem. I was checking the XML in Chrome & IE and it looked correct, but viewing the source I found the PHP XMLWriter class I was using to create the XML was changing the character “ to ". DefaultHandler doesn’t seem to like this…
I had to stop using XMLWriter() and create my own writer to output a “ actually as “ so the DefaultHandler can translate it correctly.