Debian Codegraph @

gavo/resources/web/xsl/meta-votable-to-html.xsl

raw
1 <?xml version="1.0" encoding="UTF-8"?>
2
3 <!-- A stylesheet to convert SIAP-style service metadata to HTML.
4
5 This stylesheet is made available under CC-0 by the GAVO project,
6 http://www.g-vo.org.
7 See http://creativecommons.org/publicdomain/zero/1.0/ for details.
8 -->
9
10 <xsl:stylesheet
11 xmlns:v="http://www.ivoa.net/xml/VOTable/v1.3"
12 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
13 xmlns="http://www.w3.org/1999/xhtml"
14 version="1.0">
15
16 <xsl:include href="dachs-xsl-config.xsl"/>
17
18
19 <xsl:output method="xml"
20 doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
21 doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/>
22
23 <xsl:template match="v:DESCRIPTION">
24 <p class="parbody">
25 <xsl:apply-templates/>
26 </p>
27 </xsl:template>
28
29 <xsl:template name="format-fieldlike">
30 <li><strong><xsl:value-of select="@name"/></strong>
31 (<xsl:value-of select="@datatype"
32 /><xsl:value-of select="@arraysize"/>)
33 <xsl:if test="@unit">
34 [<xsl:value-of select="@unit"/>]
35 </xsl:if>
36 <xsl:apply-templates/>
37 </li>
38 </xsl:template>
39
40 <xsl:template match="v:OPTION">
41 <li><xsl:value-of select="@value"/></li>
42 </xsl:template>
43
44 <xsl:template match="v:VALUES">
45 <xsl:if test="v:OPTION">
46 Valid values for this parameter are:
47 <ul>
48 <xsl:apply-templates/>
49 </ul>
50 </xsl:if>
51 </xsl:template>
52
53 <xsl:template match="v:PARAM">
54 <xsl:call-template name="format-fieldlike"/>
55 </xsl:template>
56
57 <xsl:template match="v:FIELD">
58 <xsl:call-template name="format-fieldlike"/>
59 </xsl:template>
60
61 <xsl:template match="v:INFO" priority="0"/>
62
63 <xsl:template match="v:INFO[@name='serviceInfo']" priority="1">
64 <h2>Service <xsl:value-of select="."/></h2>
65 <p>Access URL: <a>
66 <xsl:attribute name="href">
67 <xsl:value-of select="@value"/>
68 </xsl:attribute>
69 <xsl:value-of select="@value"/>
70 </a></p>
71 </xsl:template>
72
73 <xsl:template match="v:RESOURCE[@type='results']">
74 <xsl:apply-templates select="v:INFO"/>
75
76 <h2>Input Parameters</h2>
77 <ul>
78 <xsl:apply-templates select="v:PARAM[starts-with(@name, 'INPUT:')]"/>
79 </ul>
80
81 <h2>Result Table Columns</h2>
82
83 <ul>
84 <xsl:apply-templates select="v:TABLE/v:FIELD"/>
85 </ul>
86 </xsl:template>
87
88 <xsl:template match="/">
89 <html>
90 <head>
91 <title>Service Interface Documentation</title>
92 <meta name="robots" content="nofollow"/>
93 <xsl:call-template name="localCompleteHead"/>
94 <style type="text/css">
95 .parbody {
96 background-color: white;
97 color: #777777;
98 font-size: 80%;
99 }
100 </style>
101 </head>
102 <body>
103 <h1>Service Interface Documentation</h1>
104 <xsl:apply-templates/>
105 </body>
106 </html>
107 </xsl:template>
108 </xsl:stylesheet>