RE: [xsl] : Problems with Javascript block / Netscape

Subject: RE: [xsl] : Problems with Javascript block / Netscape
From: "Uronis, Jeremy" <Jeremy.Uronis@xxxxxxxxxxxxx>
Date: Fri, 17 Aug 2001 09:45:33 -0400
>Michael wrote:

>And there are two further points in favour of this approach.
>1) Since an XML editor and and XSLT processor will let you accidentally
>damage the innards of a <script> element while editing the XSLT code,
>it's much better to keep the static parts out of harm's way in their own
>js libraries
>2) You can invoke such libraries from multiple html pages. That way,
>they can stay cached after the first invocation and don't get sent
>again, even if the main page is refreshed.

you have good points. ill move the code out when i get a chance.
i did work the problem out though. i was wrong in my initial post.
ns can handle code such as &lt; in javascript.

when reading msdn it said to write your javascript block like so:

		<SCRIPT LANGUAGE="javascript" DEFER="true">
		  <xsl:comment>
		  <![CDATA[ 
		  
				if(document.forms[0].lstSelectedCats &&
document.forms[0].lstSelectedCats.length==0){
	
document.forms[0].lstSelectedCats.length = 1;
				
				<snip>
				
			 ]]> 
		  </xsl:comment>
		</SCRIPT>


the closing xsl:comment is what was causing the problem with netscape. in
order for this code to
work in both ie and ns you need to close your xsl:comment with two forward
slashes first like so:

  		 //</xsl:comment>


thanks - 
   jeremy


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread