How to use the AND operater in javascript within an XSLT document -
i've got script in xsl document , it's throwing error when try , use javascript , operator (&&).
if (input1=="" && input2==""){ alert ("test"); }
the error comes is: xml parsing error: not well-formed , points && operator.
how can around this?
if writing xslt writing xml document , xslt code needs well-formed xml. either escape ampersands &&
or use cdata section
<script><![cdata[ if (input1 == "" && input2 == "") { alert("test"); } ]]></script>
if trying create html or svg script elements in xslt of course third option make use of external scripts e.g. put javascript code .js
file , reference <script src="file.js"></script>
, way don't have take efforts escape script code according xml rules.
Comments
Post a Comment