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

Re: Possible to use attribute value in pattern ??

Subject: Re: Possible to use attribute value in pattern ??
From: Lionel Villard <Lionel.Villard@xxxxxxxxxxxx>
Date: Thu, 15 Jul 1999 16:53:53 +0200
lionel villard
Kay Michael wrote:

>        <smil>
>             <head>
>                 ... <region id ="toto" left="10" right="40"/>
>             </head>
>
>             <body>
>                 ... <img id="MyImg" region="toto">
>             </body>
>         </smil>
>
> The result i want is like this :
>
>     ... <Picture  Name="MyImg" Left="10" Right="40"/>
>
> yeah, but presumably he has more than one region and wants the one whose id
> matches the region attribute of the img element.
>
> this leads to:
>  <xsl:template match="img">
>    <xsl:variable name="id" expr="@id"/>
>    <xsl:variable name="region" expr="//head/region[@name=$id]"/>
> >  <Picture Name="{@id}"
> >           Left="{$region/@left}"
> >           Right="{$region/@right}"/>
> > </xsl:template>
>
> Alternatively, define a key.

tGreat hat work, thanks!! Just replace
    <xsl:variable name="id" expr="@id"/>
    by  <xsl:variable name="id" expr="@region"/>
and
    <xsl:variable name="region" expr="//head/region[@name=$id]"/>
    by <xsl:variable name="region" expr="//head/region[@id=$id]"/>




 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.