Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Daniel P. on Jun 25, 2009 12:24
open dhtmlx forum
Xml attribute escape

Hello,

I know I can use <CDATA to escape characters within xml tags but what about attrbutes values?

For example, I have a select box having the following options in xml:

<option value="something">Value desc 1</option>
<option value="something">Value desc 2</option>
<option value="something">Value desc 3</option>
<option value="something">Value desc 4</option>
<option value="something">Value desc 5</option>

Now I know that if "Something" has a & character, I could replace it with &
But what if I need to have a doublequote in the something. let's say the value would be a doublequote. How do I do that while keeping the doulequotes as my value identifier. I've tried " and \" but it does not work.

Please let me know

Thank you
Answer posted by dhxSupport on Jun 26, 2009 01:48
You can combine double (") and single (') quotes to set attributes:
<option value='something "with double quotes"'>Value desc 5</option>