[xml] DOM parser and HTML entities inside the <script> tag


I'm having a problem with the DOM parser:

When the following code is passed through the parser:

<script type="text/_javascript_">
   var d="&quot;Hello world;&quot;";

it will be converted to:

<script type="text/_javascript_">
   var d=""Hello world"";

This is because the parser is substituting '&quot;' for  '"'. 

According to w3.org the entities should not be replaced replaces inside CDATA sections, scripts or styles


The same thing applies to html tags inside the <script>:

<script type="text/_javascript_">
   var d="<p>Jack &amp; Jill</p>";

The "&amp;" should not be replaced by "&"; neither should the <p> or </p> be recognized as a start or close tag

Can this issue be corrected? Is there any way to work around this? 

Best regards,

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]