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

Popular posts from this blog

node.js - How to mock a third-party api calls in the backend -

java - Could not locate OpenAL library -

Non Unique Username with ASP.Net Identity 2.0 -