Subject: [xsl] template match on attribute, copy but change value From: "Benjamin Farrow" <lovinjess@xxxxxxxxxxx> Date: Thu, 10 Jul 2003 15:51:08 -0700 |
XML File: <test> <Element myAtt="test"> <child/> </Element> </test>
<xsl:template match="/"> <xsl:apply-templates select="*"/> </xsl:template>
<xsl:template match="@myAtt"> <xsl:copy> <!-- this is ignored and will not let me change the value --> <xsl:value-of select="'hi there'"/> </xsl:copy> </xsl:template>
<xsl:template match="node()|@*"> <xsl:copy> <xsl:apply-templates select="node()|@*"/> </xsl:copy> </xsl:template>
Expected Output: <test> <Element myAtt="hi there"> <child/> </Element> </test>
Thanks for any comments, Benjamin
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] XSL/XPath Dynamic sort ke, Fett Boba | Thread | Re: [xsl] template match on attribu, david_n_bertoni |
RE: [xsl] Using not(...a nd ... ) t, Michael Kay | Date | RE: [xsl] Using not(...a nd ... ) t, Barak |
Month |