File: multiout.xsl

package info (click to toggle)
libxt-java 0.19991105-5
  • links: PTS
  • area: main
  • in suites: woody
  • size: 1,908 kB
  • ctags: 2,762
  • sloc: java: 12,823; makefile: 52; xml: 46
file content (47 lines) | stat: -rw-r--r-- 1,286 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:xt="http://www.jclark.com/xt"
		version="1.0"
                extension-element-prefixes="xt">

<xsl:variable name="file">out</xsl:variable>

<xsl:output method="text"/>

<xsl:template match="/">
  <xt:document method="xml" href="{$file}.xml">
     <xsl:call-template name="out"/>
  </xt:document>
  <xsl:text>Created file </xsl:text>
  <xsl:value-of select="$file"/>
  <xsl:text>.xml&#xA;</xsl:text>
  <xt:document method="html" href="{$file}.html">
     <xsl:call-template name="out"/>
  </xt:document>
  <xsl:text>Created file </xsl:text>
  <xsl:value-of select="$file"/>
  <xsl:text>.html&#xA;</xsl:text>
  <xt:document method="text" href="{$file}.txt">
     <xsl:call-template name="out"/>
  </xt:document>
  <xsl:text>Created file </xsl:text>
  <xsl:value-of select="$file"/>
  <xsl:text>.txt&#xA;</xsl:text>
</xsl:template>

<xsl:template name="out">
  <html>
   <head><title>Title</title></head>
   <body>
   <p>Line 1<br/>Line 2</p>
   </body>
  </html>
</xsl:template>

<xsl:template match="*|@*">
  <xsl:copy>
    <xsl:apply-templates select="@*"/>
    <xsl:apply-templates select="node()"/>
  </xsl:copy>
</xsl:template>

</xsl:stylesheet>