|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Possible to use attribute value in pattern ??
<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"/>
>
> > Any ideas ??
>
> <xsl:template match="smil">
> <Picture Name="{body/img/@id}"
> Left="{head/region/@left}"
> Right="{head/region/@right}"/>
> </xsl:template>
>
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.
Mike Kay
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








