Project

Profile

Help

How to connect?
Download (1 KB) Statistics
| Branch: | Tag: | Revision:

he / latest9.6 / hec / samples / trax / xsl / multidoc.xsl @ 74569bc0

1
<xsl:stylesheet 
2
      xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='2.0'
3
      xmlns:date="java:java.util.Date"
4
      exclude-result-prefixes="date">
5

    
6
<!-- this stylesheet tests multi-document output by creating a new result document for each element -->
7

    
8
  <xsl:template match="/">
9
  <output>
10
    <xsl:attribute name="at" select="date:toString(date:new())" use-when="function-available('date:new', 0)"/>
11
    <xsl:apply-templates select="cities/*"/>
12
  </output>
13
  </xsl:template>  
14

    
15
  <xsl:template match="city">
16
    <xsl:result-document href="{@name}.out" encoding="iso-8859-1">
17
      <document>
18
         <xsl:copy-of select="@*"/>
19
         <xsl:apply-templates/>
20
      </document>
21
    </xsl:result-document>
22
  </xsl:template>
23
  
24
  <xsl:template match="town">
25
    <xsl:result-document href="{@name}.sax">
26
      <document>
27
         <xsl:copy-of select="@*"/>
28
         <xsl:apply-templates/>
29
      </document>
30
    </xsl:result-document>
31
  </xsl:template>  
32
      
33
</xsl:stylesheet>
(7-7/10)