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

Re: Compute attribute value from sub-element

Subject: Re: Compute attribute value from sub-element
From: Kai.Grossjohann@xxxxxxxxxxxxxxxxxx (Kai Großjohann)
Date: 16 Aug 1999 18:12:25 +0200
Re: Compute attribute value from sub-element
Kai Großjohann <Kai.Grossjohann@xxxxxxxxxxxxxxxxxx> writes:

> Suppose I had the following XML fragment:
> 
>     <entry>
>       <key>foo</key>
>       <description>A sample link</description>
>     </entry>
> 
> Suppose I would like to create the following output using XT:
> 
>     <a href="http://www.frob.org/search?type=simple&key=foo">A sample link</a>

Wasn't so difficult after all.  Here's what I did:

,-----
| <xsl:template match="entry">
|   <a>
|     <xsl:attribute name="href">
|       http://www.frob.org/search?type=simple&amp;key=<xsl:value-of select="key"/>
|     </xsl:attribute>
|     <xsl:apply-templates match="description"/>
|   </a>
| </xsl:template>
`-----

I'm sure this is not elegant and non-portable and stuff, but it
appears to work for the just-released version of XT.

Suggestions for improvements welcome! ;-)

kai
-- 
I like BOTH kinds of music.


 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.