Lists Home |
Date Index |
I have an XML which is similar to:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE TestData [<!ENTITY var1
When I try to parse this, I am getting an exception:
'<' cannot appear in attribute value.
Looks like parser replaces &var1; with
"<![CDATA[testvalue]]>", and since attribute values
can not have "<" in them, this xml can not be parsed.
And the problem goes away if I replace the entity
<!DOCTYPE TestData [<!ENTITY var1 'testvalue'>]>
However, I have to use CDATA here, cause I don't know
what the value of "var1" can be at runtime, and it
might contain quote characters or any other special
characters and it will be hard to deal with various
cases if I don't use CDATA...
Can you recommend any way I can resolve this issue?
Thanks in advance...
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.