Project

General

Profile

« Previous | Next » 

Revision 38

Added by Matt Jones over 24 years ago

added files for displaying eml-variable metadata

View differences:

xsqltest/eml-variable.xsql
1
<?xml version="1.0"?>
2
<!--
3
  * eml-variable.xsql
4
  *
5
  *      Authors: Matt Jones
6
  *    Copyright: 2000 Regents of the University of California and the
7
  *               National Center for Ecological Analysis and Synthesis
8
  *  For Details: http://www.nceas.ucsb.edu/
9
  *      Created: 2000 April 13
10
  *    File Info: '$Id$'
11
  * 
12
  * This is an XSQL (http://technet.oracle.com/tech/xml) document designed
13
  * to cause an XSLT (http://www.w3.org/TR/xslt) stylesheet transformation
14
  * for an XML document
15
-->
16
<?xml-stylesheet type="text/xsl" href="eml-variable-display.xsl"?>
17
<xsql:include-xml href="eml-variable.xml" xmlns:xsql="urn:oracle-xsql"/>
0 18

  
xsqltest/eml-variable-sort.xsl
1
<xsl:template xmlns:xsl="http://www.w3.org/TR/WD-xsl">
2
  <xsl:apply-templates select="eml_variable">
3
    <xsl:template><xsl:copy><xsl:apply-templates select="@*"/><xsl:apply-templates/></xsl:copy></xsl:template>
4
    <xsl:template match="eml_variable"><xsl:copy><xsl:apply-templates select="@*"/><xsl:apply-templates select="variable" order-by="variable_name"/></xsl:copy></xsl:template>
5
  </xsl:apply-templates>
6
</xsl:template>
0 7

  
xsqltest/eml-variable.xml
1
<?xml version="1.0"?>
2
<!DOCTYPE eml_variable>
3
<!-- '$Id$' -->
4
<!-- eml document for the NCEAS working group entitled:
5
         Intrinsic and Extrinsic Variability in Community Dynamics
6
          MODULE 4b - CLASS IVb - DATA VARIABLE DESCRIPTORS           
7
--> 
8
<eml_variable>   
9
   <meta_file_id mdatt="junk">NCEAS-0002-variable.xml</meta_file_id>
10
   <variable>
11
     <variable_name>site</variable_name>
12
     <variable_definition>site name</variable_definition>
13
     <storage_type>character</storage_type></variable>
14
     <codedef>
15
        <code>99</code>
16
        <def>Error in the super console</def>
17
     </codedef>
18
   <variable>
19
     <variable_name>lakename</variable_name>
20
     <variable_definition>lake name</variable_definition>
21
     <storage_type>character</storage_type>
22
   </variable>
23
   <variable>
24
     <variable_name>year</variable_name>
25
     <variable_definition>year of data collection, in 19YY format</variable_definition>
26
     <storage_type>integer</storage_type>
27
   </variable>
28
   <variable attrib1="this is an att">
29
     <variable_name>plankton</variable_name>
30
     <variable_definition>number of plankton in samples for that year</variable_definition>
31
     <storage_type>integer</storage_type>
32
   </variable>
33
</eml_variable> 
0 34

  
xsqltest/eml-variable-display.xsl
1
<?xml version="1.0"?>
2
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
3
<HTML>
4
  <HEAD>
5
    <STYLE>
6
      BODY {margin:0}
7
      .bg {font:8pt Verdana; background-color:purple; color:white}
8
      H1 {font:bold 14pt Verdana; width:100%; margin-top:1em}
9
      .row {font:8pt Verdana; border-bottom:1px solid #CC88CC}
10
      .header {font:bold 9pt Verdana; cursor:hand; padding:2px; border:2px outset gray}
11
    </STYLE>
12
    <XML id="eml_variable">
13
      <xsl:apply-templates select="eml_variable">
14
        <xsl:template><xsl:copy><xsl:apply-templates select="@*"/><xsl:apply-templates/></xsl:copy></xsl:template>
15
      </xsl:apply-templates>
16
    </XML>
17
    <XML id="sorted"><xsl:eval/></XML>
18
    <XML id="sortVars" src="eml-variable-sort.xsl"><xsl:eval/></XML>
19
  </HEAD>
20
  
21
  <SCRIPT><xsl:comment><![CDATA[
22
    function sort(field)
23
    {
24
      sortField.value=field;
25
	sorted.XMLDocument.loadXML(eml_variable.transformNode(sortVars.XMLDocument));
26
    }
27
  ]]></xsl:comment></SCRIPT>
28

  
29
  <SCRIPT for="window" event="onload"><xsl:comment><![CDATA[
30
    sortField = sortVars.selectSingleNode("//@order-by");
31
    sort("variable_name");
32
  ]]></xsl:comment></SCRIPT>
33
  
34
  <BODY>
35
    <TABLE width="100%" cellspacing="0">
36
      <TR><TD class="bg"/><TD class="bg"><H1>Variable listing for <U><xsl:value-of select="eml_variable/meta_file_id"/></U></H1></TD></TR>
37
      <TR>
38
        <TD class="bg" width="120" valign="top">
39
          <P>Click on the column headings to sort by that field.</P>
40
          <P>Note that sorting is by string value only and not numeric</P>
41
        </TD>
42
        <TD valign="top">
43
          <TABLE class="listing" datasrc="#sorted">
44
            <THEAD>
45
              <TD width="200"><DIV class="header" onClick="sort('variable_name')">Variable</DIV></TD>
46
              <TD width="80"><DIV class="header" onClick="sort('variable_definition')">Description</DIV></TD>
47
              <TD width="80"><DIV class="header" onClick="sort('storage_type')">Type</DIV></TD>
48
            </THEAD>
49
            <TR>
50
              <TD><DIV class="row" datafld="variable_name"><xsl:eval/></DIV></TD>
51
              <TD><DIV class="row" datafld="variable_definition"><xsl:eval/></DIV></TD>
52
              <TD><DIV class="row" datafld="storage_type" STYLE="text-align:right"><xsl:eval/></DIV></TD>
53
            </TR>
54
          </TABLE>
55
        </TD>
56
      </TR>
57
    </TABLE>    
58
  </BODY>
59
</HTML>
60
</xsl:stylesheet>
0 61

  
lib/style/eml-variable-display.xsl
1
<?xml version="1.0"?>
2
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
3
<HTML>
4
  <HEAD>
5
    <STYLE>
6
      BODY {margin:0}
7
      .bg {font:8pt Verdana; background-color:purple; color:white}
8
      H1 {font:bold 14pt Verdana; width:100%; margin-top:1em}
9
      .row {font:8pt Verdana; border-bottom:1px solid #CC88CC}
10
      .header {font:bold 9pt Verdana; cursor:hand; padding:2px; border:2px outset gray}
11
    </STYLE>
12
    <XML id="eml_variable">
13
      <xsl:apply-templates select="eml_variable">
14
        <xsl:template><xsl:copy><xsl:apply-templates select="@*"/><xsl:apply-templates/></xsl:copy></xsl:template>
15
      </xsl:apply-templates>
16
    </XML>
17
    <XML id="sorted"><xsl:eval/></XML>
18
    <XML id="sortVars" src="eml-variable-sort.xsl"><xsl:eval/></XML>
19
  </HEAD>
20
  
21
  <SCRIPT><xsl:comment><![CDATA[
22
    function sort(field)
23
    {
24
      sortField.value=field;
25
	sorted.XMLDocument.loadXML(eml_variable.transformNode(sortVars.XMLDocument));
26
    }
27
  ]]></xsl:comment></SCRIPT>
28

  
29
  <SCRIPT for="window" event="onload"><xsl:comment><![CDATA[
30
    sortField = sortVars.selectSingleNode("//@order-by");
31
    sort("variable_name");
32
  ]]></xsl:comment></SCRIPT>
33
  
34
  <BODY>
35
    <TABLE width="100%" cellspacing="0">
36
      <TR><TD class="bg"/><TD class="bg"><H1>Variable listing for <U><xsl:value-of select="eml_variable/meta_file_id"/></U></H1></TD></TR>
37
      <TR>
38
        <TD class="bg" width="120" valign="top">
39
          <P>Click on the column headings to sort by that field.</P>
40
          <P>Note that sorting is by string value only and not numeric</P>
41
        </TD>
42
        <TD valign="top">
43
          <TABLE class="listing" datasrc="#sorted">
44
            <THEAD>
45
              <TD width="200"><DIV class="header" onClick="sort('variable_name')">Variable</DIV></TD>
46
              <TD width="80"><DIV class="header" onClick="sort('variable_definition')">Description</DIV></TD>
47
              <TD width="80"><DIV class="header" onClick="sort('storage_type')">Type</DIV></TD>
48
            </THEAD>
49
            <TR>
50
              <TD><DIV class="row" datafld="variable_name"><xsl:eval/></DIV></TD>
51
              <TD><DIV class="row" datafld="variable_definition"><xsl:eval/></DIV></TD>
52
              <TD><DIV class="row" datafld="storage_type" STYLE="text-align:right"><xsl:eval/></DIV></TD>
53
            </TR>
54
          </TABLE>
55
        </TD>
56
      </TR>
57
    </TABLE>    
58
  </BODY>
59
</HTML>
60
</xsl:stylesheet>
0 61

  

Also available in: Unified diff