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

RE: Making dynamic href's in XSL

Subject: RE: Making dynamic href's in XSL
From: "Mabry, F. DR EECS" <df6954@xxxxxxxxxxxxxxxxxxxx>
Date: Wed, 31 May 2000 18:08:07 -0400
dynamic href value
The XML you included is not valid.  Remember XSL is XML.  To construct the
href _attribute_ of the a [anchor] _element_ in an XHTML document, you
should probably do something like the following:

<xsl:if test="num_active_tasks > 0">
<a>

<xsl:attribute 
 name="href"><xsl:text>show_tasks.jsp?pcode=</xsl:text><xsl:value-of
select="site_code"/><xsl:text>&#0026;project_number=</xsl:text><xsl:value-of
select="number" /></xsl:attribute>

<xsl:value-of select="number" />
</a>

</xsl:if>


I don't recall what the character is that is referenced by &#0026;.  If you
are intending that character to be in "http transfer markup" then you
probably have a little more to do.  The point is that the attribute portion
of the "a" element that you want to generate has its value set in the xsl
attribute statement.  The link's text string MUST be indicated after the
attribute is complete because it is the "value" of the "a" element.

Frank
Dr. Frank Mabry
Dept. of EE&CS, U.S. Military Academy
West Point, NY 10996
email: df6954@xxxxxxxxxxxxxxxxxxx
Phone: (914) 938-2960


Making dynamic href's in XSL
From: "Brian Burridge" <brian_burridge@xxxxxxxxxxxxx
<mailto:brian_burridge@xxxxxxxxxxxxx> >
Date: Wed, 31 May 2000 17:18:57 -0400
I'm trying to build a dynamic href like this:
<xsl:if test="num_active_tasks>0"><a
href="show_tasks.jsp?pcode=<xsl:value-of select="site_code"
/>&#0026;project_number=<xsl:value-of select="number" />"><xsl:value-of
select="number" /></a>

but I get the error "The value of attribute "href" must not contain the
'<' character. ". I understand what the error means, but I'm not sure
how to get around it. Is there a better way of building a dynamic href?

--

Brian N. Burridge
Internet Architect
Ext 3515
The Internet Group - ITSS
Cox Target Media





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


Current Thread

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.