xslt, javascript and unescaped html entities -


i have tiny little problem xslt, js , html entities, eg. within template:

<script type="text/javascript">     <xsl:value-of select="/some/node"/>     (var = 0; &lt; 5; i++) {         //            ^^^ js error     } </script>  <script type="text/javascript">     <xsl:value-of select="/some/node"/>     (var = 0; < 5; i++) {         //            ^ xslt error     } </script>  <script type="text/javascript">     <xsl:value-of select="/some/node"/>     // <![cdata[     (var = 0; < 5; i++) {         //            ^ becomes &lt;     }     // ]]> </script>   <script type="text/javascript">     <xsl:value-of select="/some/node"/>     (var = 0; <xsl:value-of disable-output-escaping="yes" select="string('&lt;')"/> 5; i++) {         // works of course     } </script> 

does have idea problem come from? thought xslt processor leave content of <script/> element unescaped when using html output method ...

i run libxslt2 version 1.1.24 on osx installed using macportsports ...

ok. long story, short answer:

it seems some libxslt versions xslt processor leaves content of <script/> element unescaped when using html output method, with others not ... therefore following recommended:

<script type="text/javascript">     <xsl:value-of select="/some/node"/>     <xsl:text disable-output-escaping="yes">         // ^ trick ...         (var = 0; < 5; i++) {             //            ^ works         }     </xsl:text> </script> 

Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -