Project

Profile

Help

How to connect?
Download (554 Bytes) Statistics
| Branch: | Tag: | Revision:

he / tags / 9.9.1.4 / samples / styles / add-ids.xsl @ c74fd4aa

1
<xsl:transform
2
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3
 version="2.0">
4
  
5
  <!-- This stylesheet adds id attributes to all item elements -->
6
  
7
  <xsl:output method="xml" indent="yes"/>
8

    
9
  <xsl:template match="*">
10
    <xsl:copy>
11
      <xsl:copy-of select="@*"/>
12
      <xsl:apply-templates/>
13
    </xsl:copy>
14
  </xsl:template>
15
  
16
  <xsl:template match="item">
17
    <xsl:copy>
18
      <xsl:copy-of select="@*"/>
19
      <xsl:attribute name="id" select="generate-id()"/>
20
      <xsl:apply-templates/>
21
    </xsl:copy>
22
  </xsl:template>
23

    
24
</xsl:transform>	
(1-1/12)