RE: [xsl] "Simple" copy all and find and replace

Subject: RE: [xsl] "Simple" copy all and find and replace
From: Jarno.Elovirta@xxxxxxxxx
Date: Tue, 8 Jul 2003 14:00:40 +0300
Hi,

> For my program I need XML-Files, where nodes like PHOTO, IMG, 
> FOTO, BILD, BILDCHEN should be renamed with the name IMAGE 
> and the original name should be saved as an attribute "oldname".
> The rest of the file should be the same. Just copy all and 

  <xsl:template match="PHOTO | IMG | FOTO | BILD | BILDCHEN">
    <IMAGE oldname="{name()}">
      <xsl:apply-templates select="@* | node()"/>
    </IMAGE>
  </xsl:template>
  <xsl:template match="@* | node()">
    <xsl:copy>
      <xsl:apply-templates select="@* | node()"/>
    </xsl:copy>
  </xsl:template>

Cheers,

Jarno

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


Current Thread