[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re:

Subject: Re:
From: "David N Bertoni/Cambridge/IBM" <david_n_bertoni@xxxxxxxxxx>
Date: Fri, 7 Jun 2002 14:10:47 -0700
onclick vbscript
Mark Turanin wrote:
> I need to find the xsl way to include arguments into a function call of a
> link element.  Here is what I tried..
>
>   <xsl:element name="A">
>            <xsl:attribute name="href">#</xsl:attribute>
>            <xsl:attribute name="onclick">vbscript:OpenWindow3
(<xsl:value-of
> select="@SSN"/>,<xsl:value-of select="@Plancode"/>)</xsl:attribute>
>             <xsl:value-of select="@SSN"/>
>  </xsl:element>
>
> Here is what I am getting and it is causing errors.
>
> <a href="#" onclick="vbscript:OpenWindow3(999-99-9999,12345)">
> 999-99-9999
> </a>
>
> I'm figuring it is because I am not surrounding each argument with "".
> However, i can't figure out how to include " in xsl.
>
> Please help.

I think this sort of thing is much easier to do using a literal result
element:

<A href='#' onclick='vbscript:OpenWindow3("{@SSN}", "{@Plancode}")'>
<xsl:value-of select="@SSN"/></A>

Of course, there's no reason why " cannot appear in a text node:

<xsl:element name="A">
  <xsl:attribute name="href">#</xsl:attribute>
  <xsl:attribute name="onclick">vbscript:OpenWindow3("<xsl:value-of select
="@SSN"/>", "<xsl:value-of select="@Plancode"/>")
</xsl:attribute>
  <xsl:value-of select="@SSN"/>
</xsl:element>

If extra whitespace matters to you, then you'll need to be careful about
embedded linefeeds.  You could also use xsl:text, if the whitespace is
undesirable, and you want to keep some standard indentation for your
stylesheet.

Dave



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


Current Thread
  • Re:
    • David N Bertoni/Cambridge/IBM - Fri, 7 Jun 2002 17:20:06 -0400 (EDT) <=

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.