xsl-list
[Top] [All Lists]

Re: XSLT - update attribute with new value

2004-11-11 14:12:58
Ann Marie Rubin wrote:

Hi David,

so I see how to use dynamically assign values to attribues but now my
problem is with a test that the value of the attribute $node (defined as
GARDEN) matches the name of the parent node for the current attribute. I don't think my test is constructed right.
<xsl:param name="attr">ROSE</xsl:param>
<xsl:param name="value">RED</xsl:param>
<xsl:param name="node">GARDEN</xsl:param>
...
    <xsl:template match="@*" priority="10">
    <xsl:variable name="test" select="$node"/>
       <xsl:attribute name="{$attr}">
            <xsl:choose>
                <xsl:when test="$test=parent[name()]"><xsl:value-of
select="$value"/></xsl:when>

I guess you mean:
<xsl:when test="$test=name(parent::*)">

                <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
            </xsl:choose>
        </xsl:attribute>
...
thanks for any light anyone can shed...

Ann Marie



--~------------------------------------------------------------------
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>
--~--




Grtz

--
Geert(_dot_)Josten(_at_)Daidalos(_dot_)nl
IT-consultant at Daidalos BV, Zoetermeer (NL)

http://www.daidalos.nl/
tel:+31-(0)79-3316961
fax:+31-(0)79-3316464

GPG: 1024D/12DEBB50

--~------------------------------------------------------------------
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>
--~--



<Prev in Thread] Current Thread [Next in Thread>