File: schema-documentation.xsl

package info (click to toggle)
emacspeak 24-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 9,092 kB
  • ctags: 4,597
  • sloc: xml: 54,699; lisp: 42,103; tcl: 1,799; makefile: 810; cpp: 603; sh: 566; ansic: 153; perl: 124
file content (39 lines) | stat: -rw-r--r-- 1,031 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
<?xml version="1.0" encoding="utf-8"?>
<!--$Id: schema-documentation.xsl,v 24.0 2006/05/03 02:54:05 raman Exp $-->
<!--Description:

Extract documentation  from an XML Schema   and display as HTML
-->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  version="1.0">
  <xsl:template match="/">
    <html>
      <title>Documentation From XML Schema</title>
      <body>
        <xsl:apply-templates select="//xsd:documentation"/>
      </body>
    </html>
  </xsl:template>
  <xsl:template match="xsd:documentation">
    <div>
      <h2>
        Documentation For
        <xsl:choose>
          <xsl:when test="../../@name">
            <em>
              <xsl:value-of select="../../@name"/>
            </em>
          </xsl:when>
          <xsl:otherwise>
            <xsl:value-of select="name(../..)"/>
          </xsl:otherwise>
        </xsl:choose>
      </h2>
      <p>
        <xsl:apply-templates/>
      </p>
    </div>
  </xsl:template>
</xsl:stylesheet>