xsl-list
[Top] [All Lists]

RE: Keep previous attributes, while adding a new one

2004-03-31 13:00:09
-----Original Message-----
From: Naomi Gronson [mailto:naomi_gronson(_at_)yahoo(_dot_)com]

Is there any way that I can retain the
<programlisting>'s attributes while adding the new
@format value.  I could list them out manually, but we
are constantly adding new attributes and I don't want
to have to update the xsl everytime a new one is
added.  Any ideas?  Thanks.


Yup!

Try:
<xsl:template match="programlisting[ancestor::para]">
  <xsl:copy>
    <xsl:copy-of select="@*" />
    <xsl:attribute name="format">bling</xsl:attribute>
    <xsl:apply-templates />
  </xsl:copy>
</xsl:template>


Cheers,

Andreas


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