Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Problems embedding Javascript with a '>' into XSL stylesheet

From: "Neil Smith [MVP Digital Media]" <neil@------.--->
To: NULL
Date: 10/2/2006 6:40:00 PM

On 2 Oct 2006 01:29:18 -0700, tamayi@g... wrote:

>I am trying to create an XSLT stylesheet in which the following
>javascript is embeded:
>
>
>	<script>
>		function xyyyczz919RemoveApostrophe(val)
>		{
>			out = "\'"; // replace this
>			add = "'"; // with this
>			temp = "" + entry; // temporary holder
>
>			while (temp.indexOf(out) > -1) {
>			pos= temp.indexOf(out);
>			temp = "" + (temp.substring(0, pos) + add +
>			temp.substring((pos + out.length), temp.length));
>
>			return temp;
>		}
>	</script>
>
>
>However, the line:
>
>while (temp.indexOf(out) > -1) {
>
>always comes out as
>
>while (temp.indexOf(out) &gt; -1) {


You could reasonably enclose everything between the <script /> 
elements in a CDATA block, an exact example matching your post is

http://www.w3schools.com/xml/xml_cdata.asp

HTH
Cheers - Neil
------------------------------------------------
Digital Media MVP : 2004-2006
http://mvp.support.microsoft.com/mvpfaqs


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent