Re: [xsl] Jscript in XSL

Subject: Re: [xsl] Jscript in XSL
From: "bryan rasmussen" <rasmussen.bryan@xxxxxxxxx>
Date: Thu, 20 Sep 2007 11:56:49 +0200
Actually it looks to me like there has been a mistunderstanding.
Vankadura wants to output javascript that affects the dom of the page,
but is laboring under the mistaken assumption that the way to do that
is to put the script inside of msxsl script. This would be wrong, just
put it inside of a normal script element in the output.

Cheers,
Bryan Rasmussen

On 9/20/07, Abel Braaksma <abel.online@xxxxxxxxx> wrote:
> See my comments below
>
> Vankadaru.Gupta@xxxxxxxxxxxxxxxxxx wrote:
> >
> > Whenever a button is clicked it should display a CONTAINER with the
> > controls (like textbox, checkbox depending on the XML). There are 3
> > buttons like that. Depending on the button clicked the container should
> > be displayed. The button name is same as container name. I have created
> > a <DIV ID=containername>. Based on this ID a Java Script function is
> > being called.  As of now all the three containers are being displayed
> > after applying XSL. But they should be displayed only on the click of
> > the respective button. I m using javascript using <msxsl:script> tag.
> >
> > JavaScript:
> > -----------
> > function tabSel(){
> >
> > document.getElementById('contentDiv1').style.display='block';
> >
> > document.getElementById('contentDiv2').style.display='none';
> >
> > document.getElementById('contentDiv3').style.display='none';
> >
> > }
> > ContentDiv is the DIV ID given.
> > I hope I m clear. Can you please help me out.
> >
> Hi Vankadura,
>
> You seem to ask a question on how to get your Javascript right. But we
> can only help you with the XSLT. If you can show us a snippet of XHTML
> or HTML that you have now (of after the transform) and a snippet of the
> same XHTML how it *should* look (try to be precise and concise, that is
> the best chance of success) *and* (finally) the part of your XSLT where
> things go wrong, or the whole XSLT if it isn't too big, then we can help
> you out fixing your XSLT to get the javascript into the right place.
>
> But from the current description we have no idea of what your final
> output looks like or should look like (and where to put this
> javascript), nor have we got any idea how your current xslt stylesheet
> looks like and guessing what you want will probably yield unwanted
> results for you :)
>
> Cheers,
> -- Abel Braaksma

Current Thread