You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by ar...@tcs.com on 2006/03/25 14:51:05 UTC

Re: opening a new window in xsl...Thanks issue resolved

Thanks all,

This issue has been resolved

Regards,

Arnab Jena
Assistant Systems Engineer
Tata Consultancy Services Limited
Bangalore,Karnataka
India
Mailto: arnab.jena@tcs.com
Website: http://www.tcs.com



"Sanket Pattekar" <sa...@gmail.com> 
03/24/2006 09:04 PM
Please respond to
users@cocoon.apache.org


To
users@cocoon.apache.org, lmorandini@ieee.org
cc

Subject
Re: opening a new window in xsl






Hello Arnab,

Add the following code under html head head tag in xsl stylesheet

<script language="JavaScript">
                    <![CDATA[
                    function image() {
                      window.open(']]><xsl:value-of 
select="samples/link"/><![CDATA[');
                    }
                    ]]>
</script>

In the above case it it uses the value from input xml file like

<samples>
<link>http://www.apache.com</link>
</samples>

If you have the value in your variable or as a parameter modify this
line appropriatly

Next for the href link use
<a href="javascript:image()">The Apache Software Foundation.</a>

Thats it and you should be thru.

Sanket

On 3/24/06, Luca Morandini <lm...@ieee.org> wrote:
> arnab.jena@tcs.com wrote:
> >
> >         I am trying to open a new window in xsl which is called within 
a
> > pipeline in sitemap.For the purpose I am wrinting a javascript 
function
> > within xsl.but i am getting an error message that the positioning of 
the
> > <xsl:script>is wrong.
> > Is it that cocoon does not recgnoize the use of the usage of 
xsl:script
> > lang="javascript" or is there something which I am missing.
> > Can anyone put some light on the issue?
>
> I'm not sure I got what you're trying to do, but:
>
> 1) Cocoon processes XSLT on the server side, but you are trying to open
> a window on the client side; hence, this cannot be done by XSLT
> processing alone.
> 2) The "xsl:script" element is an "hook" provided in XSLT 1.1 for
> processor-specific extensions, hence, something that works under Xalan
> may not work under MSXML.
>
> Anyway, why don't you just embed a "window.open()" statement in an HTML
> "script" element ?
>
> Regards,
>
> --------------------
>     Luca Morandini
> www.lucamorandini.it
> --------------------
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


ForwardSourceID:NT000079E6 


Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information.   If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited.   If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments.  Thank you