xsl-list
[Top] [All Lists]

Re: [xsl] Locating an attribute and its value indirectly

2011-11-04 18:56:12
Try:

<xsl:value-of select="../Formats/@*[name(.)=current()/@text-location]"/>

-Brandon :)


On Fri, Nov 4, 2011 at 7:52 PM, Mark <mark(_at_)knihtisk(_dot_)org> wrote:
I do not know how to write the following code to get the value of an
attribute named in the current element but found in another element:

In this case, where @text-location is 'souvenir-sheet', I want the value
'2630'.

when the context is <Inscriptions>
<Thing>
  <Inscriptions czech="XIV. Zimní olympijské hry Sarajevo '84" eng="14th
Winter Olympic Games, Sarajevo, '84" text-location="souvenir-sheet"/>
  <Formats souvenir-sheet="2630"/>
</Thing>

<xsl:value-of select="../Formats/@*=@text-location"/>
returns a boolean and

<xsl:value-of select="../Formats/@*[name(.)=@text-location]"/>
returns a blank

Am I even close? What am I doing wrong?

Thanks,
Mark



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--