Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Re: Iterate over attributes [Thread Next] Re: Iterate over attributesTo: NULL Date: 9/3/2005 11:02:00 AM
"Dimitre Novatchev" <dimitren@t...> a écrit dans le message de
news:430b8dcc$0$66260$892e7fe2@a......
>
> <elora_c@y...> wrote in message
> news:1124822081.059132.285770@g......
> > Thanks for the help. I've almost got it now. The one thing I can't
> > figure out is how to now get the corresponding 'newurlX' attribute. I
> > have
> >
> > <xsl:template match="posting">
> > <TR>
> > <TD align="left" colspan="2" bgcolor="#dcdcdc">
> > <A href="{@path}"><xsl:value-of select="@path"/></A>
> > </TD>
> > </TR>
> > <xsl:apply-templates select="@*[starts-with(name(), 'oldurl')] " />
> > </xsl:template>
> >
> > <xsl:template match="@*[starts-with(name(), 'oldurl')] ">
> > <tr>
> > <td><xsl:value-of select="."></xsl:value-of></td>
> > <td><xsl:variable name="new" select="concat('newurl',
> > translate(name(), 'oldurl', ''))"></xsl:variable><xsl:value-of
> > select="$new"></xsl:value-of></td>
> > </tr>
> > </xsl:template>
> >
> > And that will print out the name of the corresponding newurl. But I
> > can't figure out how to get the value of the attribute with that name.
> > I've tried various things with apply-templates and xsl:value-of, but I
> > just can't figure it out. I can do
> > <td><xsl:value-of select="../@newurl0" /></td>
> > to get the value of the newurl0 attribute. But when I try to replace
> > that with the variable, it complains.
>
>
>
> <xsl:value-of select="../@*[name() = concat('newurl', substring(current(),
> 7))]"/>
>
>
>
Slight correction:
<xsl:value-of select="../@*[name() = concat('newurl',
substring(name(current()),7))]"/>
Thierry
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
