Avoid invalid XML characters in ASP pages
If you hard code XML data islands into a Web page, you'll want to avoid several special 
characters that are part of XML's syntactic structure. XML won't interpret these characters correctly if left 
within an XML data source. The characters and the alternate character sequences to use in
 their place are as follows:
 
<    &lt;
&    &amp;
>    &gt;
"    &quot;
'    &apos;
 
So, instead of <Greeting>Hello, 'World'! <This> will bomb!</Greeting> you'd want to enter
<Greeting>Hello, &apos;World&apos;! &lt;This&gt; will bomb!</Greeting>
Of course, if you use the XML Document Object Model to create XML nodes, the XMLDOM takes 
care of this encoding for you. As a result, you won't need to use the alternate characters. So,
MyGreetingNode.Text = "Hello, 'World'! <This> will bomb!" is perfectly valid.
 
  


Active Server Index

Main Index

Search RD Techbase