Project

General

Profile

« Previous | Next » 

Revision 919

Added new stylesheets for displaying the eml-attribute and eml-entity modules.

View differences:

lib/style/eml-entity-display.xsl
1
<?xml version="1.0"?> 
2
<!--   
3
  *  '$RCSfile$'
4
  *      Authors: Jivka Bojilova
5
  *    Copyright: 2000 Regents of the University of California and the
6
  *               National Center for Ecological Analysis and Synthesis
7
  *  For Details: http://www.nceas.ucsb.edu/
8
  *
9
  *   '$Author$'
10
  *     '$Date$'
11
  * '$Revision$'
12
  * 
13
  * This program is free software; you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License as published by
15
  * the Free Software Foundation; either version 2 of the License, or
16
  * (at your option) any later version.
17
  *
18
  * This program is distributed in the hope that it will be useful,
19
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21
  * GNU General Public License for more details.
22
  *
23
  * You should have received a copy of the GNU General Public License
24
  * along with this program; if not, write to the Free Software
25
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
26
  *
27
  * This is an XSLT (http://www.w3.org/TR/xslt) stylesheet designed to   
28
  * convert an XML file that is valid with respect to the eml-file.dtd   
29
  * module of the Ecological Metadata Language (EML) into an HTML format    
30
  * suitable for rendering with modern web browsers. 
31
--> 
32
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">   
33

  
34
  <xsl:output method="html" encoding="iso-8859-1"/>
35
  <xsl:template match="/">
36
    <html>       
37
      <head> 	
38
        <link rel="stylesheet" type="text/css" 
39
              href="@style-path@/default.css" />
40
      </head>   
41
      <body> 	
42
        <center>           
43
          <h2>Table structure description</h2>           
44
          <h4>Ecological Metadata Language</h4>         
45
        </center>
46

  
47
        <table width="750" border="0" cellspacing="0" cellpadding="1" 
48
               class="tablehead">
49
          <tr>         
50
            <th width="25%" align="left"><xsl:text>Table Name</xsl:text></th>
51
            <td><xsl:value-of select="table-entity/entityName"/></td>
52
          </tr>          
53
	</table>         
54

  
55
	<table width="750" border="0" cellspacing="0" cellpadding="1">
56
          <tr>         
57
            <th width="25%" align="left"><xsl:text>Metadata ID</xsl:text></th>
58
            <td><xsl:value-of select="table-entity/identifier"/></td>
59
          </tr>          
60
          <tr>         
61
            <th width="25%" align="left"><xsl:text>Table Description</xsl:text></th>
62
            <td><xsl:value-of select="table-entity/entityDescription"/></td>
63
          </tr>          
64
          <tr>          
65
            <th align="left"><xsl:text>Orientation</xsl:text></th>         
66
            <td><xsl:apply-templates select="table-entity/orientation"/>               
67
                </td>
68
          </tr>          
69
          <tr>          
70
            <th align="left"><xsl:text>Case Sensitive</xsl:text></th>         
71
            <td><xsl:apply-templates select="table-entity/caseSensitive"/>               
72
                </td>
73
          </tr>          
74
          <tr>          
75
            <th align="left"><xsl:text>Number of Records</xsl:text></th>         
76
            <td><xsl:apply-templates select="table-entity/numberOfRecords"/>               
77
                </td>
78
          </tr>          
79
<!-- Removed for now until we have a better style for displaying coverage
80
          <tr>          
81
            <th align="left"><xsl:text>Geographic Coverage</xsl:text></th>         
82
            <td>
83
		<xsl:if test="geographic_coverage/paragraph/text() or geographic_coverage/coordinates/lattitude/text() or geographic_coverage/coordinates/longitude/text()"><ul>
84
                <xsl:for-each select="geographic_coverage">
85
                <li><xsl:for-each select="paragraph">
86
                      <xsl:value-of select="."/><br/>
87
                    </xsl:for-each>                     
88
                    <xsl:for-each select="coordinates">                        
89
                      <xsl:value-of select="lattitude"/>la -                         
90
                      <xsl:value-of select="longitude"/>lo<br/>
91
                    </xsl:for-each>                 
92
                </li>               
93
                </xsl:for-each>               
94
                </ul></xsl:if>
95
                </td>
96
          </tr>          
97
-->
98
<!-- Removed for now until we have a better style for displaying coverage
99
          <tr>          
100
            <th align="left"><xsl:text>Temporal Coverage</xsl:text></th>         
101
            <td>
102
		<xsl:if test="temporal_coverage/*/*/*/text()"><ul>
103
                <xsl:for-each select="temporal_coverage">                 
104
                <li><xsl:text>Start Date </xsl:text>
105
                    <xsl:apply-templates select="start_date/datetime"/> 
106
                    <xsl:text> - Stop Date </xsl:text>
107
                    <xsl:apply-templates select="stop_date/datetime"/>
108
                </li>
109
                </xsl:for-each>
110
                </ul></xsl:if>
111
                </td>
112
          </tr>          
113
-->
114

  
115
        </table>
116
      </body>
117
    </html>
118
  </xsl:template>
119

  
120
  <xsl:template match="table-entity/identifier">
121
    <table border="0" cellspacing="0" cellpadding="1">
122
      <tr>
123
        <td class="highlight">
124
          <b><xsl:text>Metadata ID:</xsl:text></b>
125
        </td>
126
        <td>
127
          <xsl:value-of select="."/>
128
        </td>
129
      </tr>
130
    </table>
131
  </xsl:template>
132

  
133
  <xsl:template match="orientation">
134
      <xsl:value-of select="@columnorrow"/>
135
  </xsl:template>
136

  
137
  <xsl:template match="caseSensitive">
138
    <xsl:choose>
139
      <xsl:when test="@yesorno='no'">No case sensitive fields</xsl:when>
140
      <xsl:when test="@yesorno='yes'">Fields are case sensitive</xsl:when>
141
    </xsl:choose>
142
  </xsl:template>
143

  
144
  <xsl:template match="datetime">
145
    <xsl:value-of select="year"/><xsl:text>/</xsl:text>
146
    <xsl:value-of select="month"/><xsl:text>/</xsl:text>
147
    <xsl:value-of select="day"/><xsl:text> </xsl:text>
148
    <xsl:value-of select="hour"/><xsl:text>:</xsl:text>
149
    <xsl:value-of select="minute"/><xsl:text>:</xsl:text>
150
    <xsl:value-of select="second"/><xsl:text>:</xsl:text>
151
    <xsl:value-of select="second_fraction"/>
152
  </xsl:template>
153

  
154
</xsl:stylesheet> 
0 155

  
lib/style/eml-attribute-display.xsl
1
<?xml version="1.0"?>
2
<!--
3
  *  '$RCSfile$'
4
  *      Authors: Matt Jones
5
  *    Copyright: 2000 Regents of the University of California and the
6
  *               National Center for Ecological Analysis and Synthesis
7
  *  For Details: http://www.nceas.ucsb.edu/
8
  *
9
  *   '$Author$'
10
  *     '$Date$'
11
  * '$Revision$'
12
  * 
13
  * This program is free software; you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License as published by
15
  * the Free Software Foundation; either version 2 of the License, or
16
  * (at your option) any later version.
17
  *
18
  * This program is distributed in the hope that it will be useful,
19
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21
  * GNU General Public License for more details.
22
  *
23
  * You should have received a copy of the GNU General Public License
24
  * along with this program; if not, write to the Free Software
25
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
26
  *
27
  * This is an XSLT (http://www.w3.org/TR/xslt) stylesheet designed to
28
  * convert an XML file that is valid with respect to the eml-variable.dtd
29
  * module of the Ecological Metadata Language (EML) into an HTML format 
30
  * suitable for rendering with modern web browsers.
31
-->
32
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
33

  
34
  <xsl:output method="html" encoding="iso-8859-1"/>
35

  
36
  <xsl:template match="/">
37
    <html>
38
      <head>
39
        <link rel="stylesheet" type="text/css" 
40
              href="@style-path@/default.css" />
41
      </head>
42
      <body>
43
        <center>
44
          <h1>Attribute structure description</h1>
45
          <h3>Ecological Metadata Language</h3>
46
        </center>
47
        
48
        <xsl:apply-templates select="eml-attribute/identifier"/>
49

  
50
        <h3>Attributes in the Data Set:</h3>
51
        <table width="100%">
52
        <tr>
53
        <th class="tablehead"><xsl:text>Attribute Name</xsl:text></th>
54
        <th class="tablehead"><xsl:text>Attribute Definition</xsl:text></th>
55
        <th class="tablehead"><xsl:text>Unit</xsl:text></th>
56
        <th class="tablehead"><xsl:text>Type</xsl:text></th>
57
        <th class="tablehead"><xsl:text>Codes</xsl:text></th>
58
        <th class="tablehead"><xsl:text>Range</xsl:text></th>
59
        <th class="tablehead"><xsl:text>Missing</xsl:text></th>
60
        <th class="tablehead"><xsl:text>Precision</xsl:text></th>
61
        </tr>
62

  
63
        <xsl:for-each select="eml-attribute/attribute">
64
          <tr valign="top">
65
            <xsl:attribute name="class">
66
              <xsl:choose>
67
                <xsl:when test="position() mod 2 = 1">rowodd</xsl:when>
68
                <xsl:when test="position() mod 2 = 0">roweven</xsl:when>
69
              </xsl:choose>
70
            </xsl:attribute>
71

  
72
          <td><b><xsl:value-of select="attributeName"/></b>
73
              </td>
74
          <td><xsl:value-of select="attributeDefinition"/>
75
              </td>
76
          <td><xsl:value-of select="unit"/>
77
              </td>
78
          <td><xsl:value-of select="dataType"/>
79
              </td>
80
          <td><ul>
81
              <xsl:for-each select="attributeDomain/enumeratedDomain">
82
                <li><xsl:value-of select="code"/>
83
                    <xsl:text> - </xsl:text>
84
                    <xsl:value-of select="definition"/>
85
                </li>
86
              </xsl:for-each>
87
              </ul>
88
              </td>
89
          <td><ul>
90
              <xsl:for-each select="attributeDomain/numericDomain">
91
                <li><xsl:value-of select="minimum"/>
92
                    <xsl:text> - </xsl:text>
93
                    <xsl:value-of select="maximum"/>
94
                </li>
95
              </xsl:for-each>
96
              </ul>
97
              </td>
98
          <td><xsl:for-each select="missingValueCode">
99
                <xsl:value-of select="."/><br />
100
              </xsl:for-each>
101
              </td>
102
          <td><xsl:value-of select="precision"/>
103
              </td>
104
          </tr>
105
        </xsl:for-each>
106
        </table>
107

  
108
      </body>
109
    </html>
110
  </xsl:template>
111

  
112
  <xsl:template match="identifier">
113
    <table>
114
      <tr>
115
        <td class="highlight">
116
           <b><xsl:text>Metadata File ID:</xsl:text></b>
117
        </td>
118
        <td>
119
            <xsl:value-of select="."/>
120
        </td>
121
      </tr>
122
    </table>
123
  </xsl:template>
124
</xsl:stylesheet>
0 125

  

Also available in: Unified diff