Attachment 'XSLT Stylesheet.xml'

Download

   1 <?xml version="1.0" encoding="utf-8"?>
   2 <xsl:stylesheet version="1.0" xmlns="http://www.w3.org/1999/xhtml"
   3                               xmlns:html="http://www.w3.org/1999/xhtml"
   4                               xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   5                               exclude-result-prefixes="html xsl"
   6 >
   7   <xsl:namespace-alias stylesheet-prefix="html" result-prefix="#default" />
   8 
   9   <xsl:output method="html" version="1.0" encoding="utf-8" indent="yes" />
  10 
  11   <xsl:template match="/">
  12     <html>
  13       <xsl:apply-templates mode="head" />
  14       <xsl:apply-templates />
  15     </html>
  16   </xsl:template>
  17 
  18   <xsl:template match="topic" mode="head">
  19     <head>
  20       <xsl:apply-templates mode="head" />
  21     </head>
  22   </xsl:template>
  23 
  24   <xsl:template match="title" mode="head">
  25     <title>
  26       <xsl:value-of select="./text()" />
  27     </title>
  28   </xsl:template>
  29 
  30   <xsl:template match="text()" mode="head">
  31     <!-- Ignore it -->
  32   </xsl:template>
  33 
  34   <xsl:template match="topic">
  35     <xsl:apply-templates />
  36   </xsl:template>
  37 
  38   <xsl:template match="body">
  39     <body>
  40       <h2><xsl:value-of select="preceding-sibling::title/text()" /></h2>
  41 
  42       <xsl:apply-templates />
  43     </body>
  44   </xsl:template>
  45 
  46   <xsl:template match="p">
  47     <div>
  48       <xsl:value-of select="./text()" />
  49     </div>
  50   </xsl:template>
  51 
  52   <xsl:template match="text()">
  53     <!-- Ignore -->
  54   </xsl:template>
  55 </xsl:stylesheet>

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2012-01-26 21:54:52, 0.5 KB) [[attachment:XML Input.xml]]
  • [get | view] (2012-01-26 21:54:59, 1.4 KB) [[attachment:XSLT Stylesheet.xml]]
 All files | Selected Files: delete move to page

You are not allowed to attach a file to this page.