Altova Mailing List Archives

Re: [xsl] adding attributes to an existing element

From: Joerg Heinicke <joerg.heinicke@------>
Date: 10/15/2002 7:51:00 AM
<xsl:template match="/db/*">
      <xsl:copy-of select="@*"/>
      <xsl:attribute name="newattribute">newAttributeValue</xsl:attribute>



Saverio Perugini wrote:
On Tue, 15 Oct 2002, Jeni Tennison wrote:

Try copying the existing attributes with xsl:copy-of. Something like:

<xsl:template match="name">
 <name number="20">
   <xsl:copy-of select="@*" />

Thanks.  However, can this solution be used if I do not know the
element name (in this case, `name') a-priori?

For example, if I'd like to do this in:

<xsl:template match="/db/*">


S. Perugini


System Development
Fon  +49(0)341-979-7419
Fax  +49(0)341-979-7409

VIRBUS hat jetzt als erster deutscher Softwarehersteller die Zertifizierung 
f&uuml;r den 3D Secure-Authentifizierungsstandard "Verified by Visa" erhalten. 
Details unter

XSL-List info and archive:


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