This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Global change of an attribute name


Chris Powell wrote:
> 
> I would prefer that the attribute be called REND.  Is there a way
> to change this globally anywhere it appears (<xsl:template match="@R">, I
> presume), or does it have to be adressed on an element by element level?

That should work, as long as you apply-templates to attributes at all places
in your document where this attribute is likely to occur. Of course you
can't create attributes unless you give them a parent element to appear
in - that's what <bob> is for.

<xsl:template match="*">
  <bob>
    <xsl:apply-templates select="@*|*|text()" />
  </bob>
</xsl:template>

<xsl:template match="@R">
  <xsl:attribute name="REND">
    <xsl:value-of select="." />
  </xsl:attribute>
</xsl:template>

This may not work using saxon, but it does with xalan. I'll do some
more investigating.

-- 
Warren Hedley


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]