0

I can't remember of find, but I know there were a way using something like <[CODE to write code inside the xml without have problems with the xml reserved symbols.. Does anyone knows?

T.J. Crowder
  • 1,031,962
  • 187
  • 1,923
  • 1,875
The Student
  • 27,520
  • 68
  • 161
  • 264
  • See also: [When is a CDATA section necessary within a script tag?](http://stackoverflow.com/questions/66837/when-is-a-cdata-section-necessary-within-a-script-tag) and [Should I use “\]\]>” or “//\]\]>” for closing a CDATA section into xHTML](http://stackoverflow.com/questions/2375217/should-i-use-or-for-closing-a-cdata-section-into-xhtml) – Shog9 Sep 22 '10 at 16:26

1 Answers1

5

Yep, using CDATA - http://www.w3schools.com/xml/xml_cdata.asp

Example:

<script>
<![CDATA[
function matchwo(a,b)
{
if (a < b && a < 0) then
  {
  return 1;
  }
else
  {
  return 0;
  }
}
]]>
</script>
T.J. Crowder
  • 1,031,962
  • 187
  • 1,923
  • 1,875
Lloyd
  • 29,197
  • 4
  • 84
  • 98