Following is my parsing code to parse the xml
snippets of my one of the xml parsing is <cell cellStyle="COLUMN_HEADER" cellType="1">Yatin & Baraiya</cell>
While parsing this string with following code snippets i get only "Yatin" value instead of the this value "Yatin & Baraiya".
The parser will skip my all the string character after "n".I think it will not read & this character.Now what should i do with below code to get full string characters.
Here i am using the stax parsing technique for parsing the xml.
Please anybody help me if you have any idea about this.
As I expected, it's your code that is ignoring that part of the text element. You only work with the first node following after a start-element node and ignore any others. So when the parser splits up a text node into more than one part -- as it is allowed to do -- you ignore all but the first part.
And by the way: I added code tags to your post. See how readable it looks now? Could you do that yourself in future?
No, it's just XML so you just need to escape the "&" properly as "&" in the document. URL-encoding is pointless.
But if you don't do that then the parser will throw an exception. That isn't happening so that must mean that the XML is well-formed, which means the ampersand is correctly escaped.
Joined: Jul 17, 2012
hy thanks to all
finally i had find the solution of my issue.
below is my changed code:
Joined: Jul 17, 2012
Here i add the one more point for the said issue solution.Check the following code.
As per reading the API and getting the help from my team mate .,He said that
if the String is like :Yatin & Baraiya
then event.asCharacters() method will read chunk of characters from the string....[so it is read first Yatin then again the event.isCharacters() event fire and it will again read the reaming part of my string data]
then at the end it will read full string data,
thanks to my team leader.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: & characters is not getting with stax parser