CDATA in element attributes?
-
does anyone know how to tell the parser to ignore special characters in element attributes? say i have an element:
<setting name="CommandLine" value="notepad.exe "C:\Documents and Settings\moralja\My Documents\text\text.txt""></setting>
this will not parse correctly because of the quote marks inside the value attribute. just encoding the quotes with " works, but i am going to have possibly thousands of entries, i would rather have some way, like the CDATA thing, to tell the parser to ignore the data altogether any ideas? -John -
does anyone know how to tell the parser to ignore special characters in element attributes? say i have an element:
<setting name="CommandLine" value="notepad.exe "C:\Documents and Settings\moralja\My Documents\text\text.txt""></setting>
this will not parse correctly because of the quote marks inside the value attribute. just encoding the quotes with " works, but i am going to have possibly thousands of entries, i would rather have some way, like the CDATA thing, to tell the parser to ignore the data altogether any ideas? -JohnJohn Morales wrote: just encoding the quotes with " works, but i am going to have possibly thousands of entries, i would rather have some way, like the CDATA thing, to tell the parser to ignore the data altogether I may be wrong but the answer is no. If you think about it having quotes like that in the attribute value breaks the whole parsing of the element. I would recommend you move that attribute to an element e.g.:
<setting name="CommandLine">notepad.exe "C:\Documents and Settings\moralja\My Documents\text\text.txt"</setting>
It actually makes more sense that way too. And if you think that will be a pain with thousands of entries, you could always write a simple XSL file which does it for you in a couple of minutes :) regards, Paul Watson Bluegrass Cape Town, South Africa Simon Walton wrote: "You come across a lot of people who call themselves realists, when they are actually pessimists attempting to look intelligent."