Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Iterate over attributes

From: "Thierry Favier" <tfavier_nonews@-------.-->
To: 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




transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent