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

Looking up elements with {@attname}

Subject: Looking up elements with {@attname}
From: Klaas Bals <kbals@xxxxxxxxxxx>
Date: Sun, 23 May 1999 17:20:30 +0200
attname
Hi,

I have some problems XSL... What I want to do is look up an element in a
template-rule when its attribute is the same as an attribute of the
current element. I'll try to give a simplified example:

<element att2="same-value" att3="firstvalue"/>
<element att2="same-value" att3="secondvalue"/>

<xsl:stylesheet>
    <xsl:template match="element">
        <xsl:value-of select="@att3"/>
        <xsl:text> found </xsl:text>
        <xsl:value-of select="//element[@att2={./@att2}]/@att3"/>
    </xsl:template>
</xsl:stylesheet>

I would like as output:
-----------
firstvalue found secondvalue
secondvalue found firstvalue
-----------

If the stylesheet above would be valid, I think I would get the correct
output, but the problem is that the last "xsl:value-of" element isn't
valid. More specifically the part after the "=" sign {./@att2} is
invalid. LotusXSL complaints about that it should stand between quotes,
but when I put it between (single) quotes, LotusXSL will look for an
element with its att2="{./@att2}", with this string "{./@att2}" as the
value for attribute "att2".
I also tried with an xsl:variable element, but then it complaints about
the $varname that should stand between quotes...

Can somebody understand what I'm saying? This topic was perhaps
discussed before, if so, please point me to the URL where I can find
some information... I tried looking for an answer in the archives and
all xml-sites, but couldn't find a thing...

Thanks for your time!
Klaas



 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.