Re: java sax parser special characters
shivaraj wrote:
I am getting special characters in my xml file because of which the
What is the source of this XML file? Do you generate it, or is it from some
external source?
parser is failing. I know that we can replace the special characters
So the XML file is input, right?
by & kind of place holders to make it work. But my trouble is, the
xml file will be generated by calling some API's. We cant read each
What APIs? Is this a third-party library?
characters of the return value of this API to check for special
character and replace it.
Is the XML file well formed? If not, you need to find a way to get the input
in well-formed XML.
(XML file is having more than 2 lakh lines)
"lakh" is not an SI unit. This is an international group. Please use
standard units.
So is there a easy way of forming this XML which will take the whole
Are you now saying that the XML file is output? Which is it, input to the
process or output from the process?
string having special characters into double quotes "' and treat it as
a single string?( I tried double quotes but it did not work...any
other approach please!? )
Are you asking if you could put quotes in the file itself? That would not
work, as the result would not be well-formed XML.
You say things like that you "tried double quotes but it did not work", but
you give so little detail that it's impossible to help you. What constitutes
"trying double quotes"? Did you insert them into the file? Read the file
into a String, then surround the contents with quotes? Paste double-quotes on
sticky memo paper all over the ceiling?
Tell us about the APIs. Are they third-party APIs? In-house? Part of the
project? External library?
Have you run the XML file through a validator to make sure that it's at least
well formed?
--
Lew