Project

General

Profile

« Previous | Next » 

Revision 57

Added by bojilova about 24 years ago

no message

View differences:

xsqltest/eml-file.xsql
1
<?xml version="1.0"?>
2
<!--
3
  * eml-file.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
<xsql:include-xml href="eml-file.xml" xmlns:xsql="urn:oracle-xsql"/>
0 17

  
xsqltest/eml-file.xml
1
<?xml version="1.0"?>
2
<!DOCTYPE eml-file><!-- '$Id$' --><!-- eml document for the NCEAS working group entitled:         Intrinsic and Extrinsic Variability in Community Dynamics          MODULE 4b - CLASS IVb - DATA STRUCTURAL DESCRIPTORS           --> <eml-file description="Data structural descriptors">
3
<meta_file_id description="Unique identifier of this metadata record">NCEAS-1998-2244-Dist-File</meta_file_id>
4
  <file description="Data set file">
5
    <file_name description="File name">NCEAS-1998-2244-Dist.csv</file_name>
6
    <file_size description="Size of file">
7
      <amount description="Amount">3821</amount>
8
      <unit description="Unit">KB</unit>
9
    </file_size>
10
    <format description="File type and compression schemes employed">
11
      <!--(compressed|encoded|base_file_type)-->
12
      <base_file_type description="Base file type">
13
        <!--(ASCII|binary)-->
14
        <ASCII description="ASCII">
15
          <record_delimiter description="Record delimiter"/>
16
        </ASCII>
17
      </base_file_type>
18
    </format>
19
    <orientation description="Is file column major or row major?" columnorrow="columnmajor"/>
20
    <header_lines description="Number of header lines or information that prepares data">1</header_lines>
21
    <case_sensitive description="Case sensitivity of field" yesorno="n"/>
22
    <geographic_coverage description="Geographic coverage">
23
      <paragraph description="Paragraph of text"></paragraph>
24
      <coordinates description="Cartesian Coordinates">
25
        <lattitude description="Lattitude coordinates"></lattitude>
26
        <longitude description="Longitude coordinates"></longitude>
27
      </coordinates>
28
    </geographic_coverage>
29
    <temporal_coverage description="Temporal coverage">
30
      <start_date description="Date data collection commenced">
31
        <datetime description="Date and time as designated in ISO 8601">
32
          <year description="Year in YYYY format"/>
33
          <month description="Month in MM format"/>
34
          <day description="Day of month in DD format"/>
35
          <hour description="Hour in hh"/>
36
          <minute description="Minute in mm"/>
37
          <second description="Seconds in ss"/>
38
          <second_fraction description="One or more digits representing a decimal fraction of a second"/>
39
          <time_zone_designator description="Time zone designator"/>
40
        </datetime>
41
      </start_date>
42
      <stop_date description="Date data collection terminated">
43
        <datetime description="Date and time as designated in ISO 8601">
44
          <year description="Year in YYYY format"/>
45
          <month description="Month in MM format"/>
46
          <day description="Day of month in DD format"/>
47
          <hour description="Hour in hh"/>
48
          <minute description="Minute in mm"/>
49
          <second description="Seconds in ss"/>
50
          <second_fraction description="One or more digits representing a decimal fraction of a second"/>
51
          <time_zone_designator description="Time zone designator"/>
52
        </datetime>
53
      </stop_date>
54
    </temporal_coverage>
55
    <authentication description="Authentication procedures or techniques">MD5 Checksum for verification: 41edbfbce8c32ff18ae589b19ef07cb2</authentication>
56
    <data_problem description="Data anomalies; description of missing data">
57
      <paragraph description="Paragraph of text">Occasional values are missing</paragraph>
58
    </data_problem>
59
  </file>
60
</eml-file>
0 61

  
xsqltest/eml-file2.xsql
1
<?xml version="1.0"?>
2
<!--
3
  * eml-file.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-file-display.xsl"?><xsql:include-xsql href="eml-file.xsql" xmlns:xsql="urn:oracle-xsql"/>
0 17

  
xsqltest/eml-file-display.xsl
1
<?xml version="1.0"?> 
2
<!--   
3
* eml-file-display.xsl   
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 17   
10
*    File Info: '$Id$'   
11
*   
12
* This is an XSLT (http://www.w3.org/TR/xslt) stylesheet designed to   
13
* convert an XML file that is valid with respect to the eml-variable.dtd   
14
* module of the Ecological Metadata Language (EML) into an HTML format    
15
* suitable for rendering with modern web browsers. 
16
--> 
17
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">    
18

  
19
  <xsl:output method="html"/>
20
  <xsl:template match="/">
21
    <html>       
22
      <head> 	
23
        <link rel="stylesheet" type="text/css" href="./rowcol.css" />
24
      </head>   
25
      <body class="emlbody"> 	
26
        <center>           
27
          <h1>File structure description</h1>           
28
          <h3>Ecological Metadata Language</h3>         
29
        </center>
30
        <xsl:apply-templates select="eml-file/meta_file_id"/>          
31
        <h3>Files in the Data Set:</h3>         
32
        <table width="100%">         
33
          <tr class="rowodd">         
34
            <th><xsl:text>File Name</xsl:text></th>         
35
            <th><xsl:text>File Size</xsl:text></th>         
36
            <th><xsl:text>File Format</xsl:text></th>         
37
            <th><xsl:text>Orientation</xsl:text></th>         
38
            <th><xsl:text>Header Lines</xsl:text></th>         
39
            <th><xsl:text>Case Sensitive</xsl:text></th>         
40
            <th><xsl:text>Geographic Coverage</xsl:text></th>         
41
            <th><xsl:text>Temporal Coverage</xsl:text></th>         
42
            <th><xsl:text>Authentication</xsl:text></th>         
43
            <th><xsl:text>Data Problem</xsl:text></th>         
44
          </tr>          
45

  
46
          <xsl:for-each select="eml-file/file">           
47
          <tr valign="top">             
48
            <xsl:attribute name="class">               
49
              <xsl:choose>                 
50
                <xsl:when test="position() mod 2 = 1">rowwhite</xsl:when>                
51
                <xsl:when test="position() mod 2 = 0">rowlight</xsl:when>               
52
              </xsl:choose>             
53
            </xsl:attribute>            
54
            <td><b><xsl:value-of select="file_name"/></b>               
55
                <xsl:text><![CDATA[&nbsp;]]></xsl:text></td>           
56
            <td><xsl:value-of select="file_size/amount"/>
57
                <xsl:value-of select="file_size/unit"/>               
58
                <xsl:text><![CDATA[&nbsp;]]></xsl:text></td>           
59
            <td><xsl:apply-templates select="format"/>               
60
                <xsl:text><![CDATA[&nbsp;]]></xsl:text></td>           
61
            <td><xsl:apply-templates select="orientation"/>               
62
                <xsl:text><![CDATA[&nbsp;]]></xsl:text></td>           
63
            <td><xsl:value-of select="header_lines"/>               
64
                <xsl:text><![CDATA[&nbsp;]]></xsl:text></td>           
65
            <td><xsl:apply_templates select="case_sensitive"/>               
66
                <xsl:text><![CDATA[&nbsp;]]></xsl:text></td>           
67
            <td><ul>               
68
                <xsl:for-each select="geographic_coverage">
69
                <li><xsl:for-each select="paragraph">
70
                      <xsl:value-of select="."/><br/>
71
                    </xsl:for-each>                     
72
                    <xsl:for-each select="coordinates">                        
73
                      <xsl:value-of select="lattitude"/>                        
74
                      <xsl:value-of select="longitude"/><br/>
75
                    </xsl:for-each>                 
76
                </li>               
77
                </xsl:for-each>               
78
                </ul>               
79
                <xsl:text><![CDATA[&nbsp;]]></xsl:text></td>           
80
            <td><ul>               
81
                <xsl:for-each select="temporal_coverage">                 
82
                <li><xsl:text>Start Date </xsl:text>
83
                    <xsl:apply-templates select="start_date/datetime"/> 
84
                    <xsl:text> - Stop Date </xsl:text>
85
                    <xsl:apply-templates select="stop_date/datetime"/>
86
                </li>
87
                </xsl:for-each>
88
                </ul>
89
                <xsl:text><![CDATA[&nbsp;]]></xsl:text></td>
90
            <td><xsl:for-each select="authentication">
91
                <xsl:value-of select="."/><br />
92
                </xsl:for-each>
93
                <xsl:text><![CDATA[&nbsp;]]></xsl:text></td>
94
            <td><xsl:for-each select="data_problem">
95
                  <xsl:for-each select="paragraph"/>
96
                    <xsl:value-of select="."/><br/>
97
                  </xsl:for-each>
98
                </xsl:for-each>
99
                <xsl:text><![CDATA[&nbsp;]]></xsl:text></td>
100
          </tr>
101
          </xsl:for-each>
102
        </table>
103
      </body>
104
    </html>
105
  </xsl:template>
106

  
107
  <xsl:template match="meta_file_id">
108
    <table>
109
      <tr>
110
        <td class="shaded">
111
          <b><xsl:text>Metadata File ID:</xsl:text></b>
112
        </td>
113
        <td>
114
          <xsl:value-of select="."/>
115
        </td>
116
      </tr>
117
    </table>
118
  </xsl:template>
119

  
120
  <xsl:template match="format">
121
    <xsl:choose>
122
       <xsl:when test="compressed">Compressed - <xsl:value-of select="compressed"/></xsl:when>
123
       <xsl:when test="encoded">Encoded - <xsl:value-of select="encoded"/></xsl:when>
124
       <xsl:when test="base_file_type/ASCII">ASCII file <xsl:value-of select="record_delimiter"/></xsl:when>
125
       <xsl:when test="base_file_type/binary">Binary file</xsl:when>
126
     </xsl:choose>
127
  </xsl:template>
128

  
129
  <xsl:template match="orientation">
130
    <xsl:choose>
131
      <xsl:when test="@columnorrow='columnmajor'">File column is major</xsl:when>
132
      <xsl:when test="@columnorrow='rowmajor'">File row is major</xsl:when>
133
     </xsl:choose>
134
  </xsl:template>
135

  
136
  <xsl:template match="case_sensitive">
137
    <xsl:choose>
138
      <xsl:when test="@yesorno='n'">No case sensitive fields</xsl:when>
139
      <xsl:when test="@yesorno='y'">Fields are case sensitive</xsl:when>
140
    </xsl:choose>
141
  </xsl:template>
142

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

  
153
</xsl:stylesheet> 
0 154

  
lib/style/eml-file-display.xsl
1
<?xml version="1.0"?> 
2
<!--   
3
* eml-file-display.xsl   
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 17   
10
*    File Info: '$Id$'   
11
*   
12
* This is an XSLT (http://www.w3.org/TR/xslt) stylesheet designed to   
13
* convert an XML file that is valid with respect to the eml-variable.dtd   
14
* module of the Ecological Metadata Language (EML) into an HTML format    
15
* suitable for rendering with modern web browsers. 
16
--> 
17
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">    
18

  
19
  <xsl:output method="html"/>
20
  <xsl:template match="/">
21
    <html>       
22
      <head> 	
23
        <link rel="stylesheet" type="text/css" href="./rowcol.css" />
24
      </head>   
25
      <body class="emlbody"> 	
26
        <center>           
27
          <h1>File structure description</h1>           
28
          <h3>Ecological Metadata Language</h3>         
29
        </center>
30
        <xsl:apply-templates select="eml-file/meta_file_id"/>          
31
        <h3>Files in the Data Set:</h3>         
32
        <table width="100%">         
33
          <tr class="rowodd">         
34
            <th><xsl:text>File Name</xsl:text></th>         
35
            <th><xsl:text>File Size</xsl:text></th>         
36
            <th><xsl:text>File Format</xsl:text></th>         
37
            <th><xsl:text>Orientation</xsl:text></th>         
38
            <th><xsl:text>Header Lines</xsl:text></th>         
39
            <th><xsl:text>Case Sensitive</xsl:text></th>         
40
            <th><xsl:text>Geographic Coverage</xsl:text></th>         
41
            <th><xsl:text>Temporal Coverage</xsl:text></th>         
42
            <th><xsl:text>Authentication</xsl:text></th>         
43
            <th><xsl:text>Data Problem</xsl:text></th>         
44
          </tr>          
45

  
46
          <xsl:for-each select="eml-file/file">           
47
          <tr valign="top">             
48
            <xsl:attribute name="class">               
49
              <xsl:choose>                 
50
                <xsl:when test="position() mod 2 = 1">rowwhite</xsl:when>                
51
                <xsl:when test="position() mod 2 = 0">rowlight</xsl:when>               
52
              </xsl:choose>             
53
            </xsl:attribute>            
54
            <td><b><xsl:value-of select="file_name"/></b>               
55
                <xsl:text><![CDATA[&nbsp;]]></xsl:text></td>           
56
            <td><xsl:value-of select="file_size/amount"/>
57
                <xsl:value-of select="file_size/unit"/>               
58
                <xsl:text><![CDATA[&nbsp;]]></xsl:text></td>           
59
            <td><xsl:apply-templates select="format"/>               
60
                <xsl:text><![CDATA[&nbsp;]]></xsl:text></td>           
61
            <td><xsl:apply-templates select="orientation"/>               
62
                <xsl:text><![CDATA[&nbsp;]]></xsl:text></td>           
63
            <td><xsl:value-of select="header_lines"/>               
64
                <xsl:text><![CDATA[&nbsp;]]></xsl:text></td>           
65
            <td><xsl:apply_templates select="case_sensitive"/>               
66
                <xsl:text><![CDATA[&nbsp;]]></xsl:text></td>           
67
            <td><ul>               
68
                <xsl:for-each select="geographic_coverage">
69
                <li><xsl:for-each select="paragraph">
70
                      <xsl:value-of select="."/><br/>
71
                    </xsl:for-each>                     
72
                    <xsl:for-each select="coordinates">                        
73
                      <xsl:value-of select="lattitude"/>                        
74
                      <xsl:value-of select="longitude"/><br/>
75
                    </xsl:for-each>                 
76
                </li>               
77
                </xsl:for-each>               
78
                </ul>               
79
                <xsl:text><![CDATA[&nbsp;]]></xsl:text></td>           
80
            <td><ul>               
81
                <xsl:for-each select="temporal_coverage">                 
82
                <li><xsl:text>Start Date </xsl:text>
83
                    <xsl:apply-templates select="start_date/datetime"/> 
84
                    <xsl:text> - Stop Date </xsl:text>
85
                    <xsl:apply-templates select="stop_date/datetime"/>
86
                </li>
87
                </xsl:for-each>
88
                </ul>
89
                <xsl:text><![CDATA[&nbsp;]]></xsl:text></td>
90
            <td><xsl:for-each select="authentication">
91
                <xsl:value-of select="."/><br />
92
                </xsl:for-each>
93
                <xsl:text><![CDATA[&nbsp;]]></xsl:text></td>
94
            <td><xsl:for-each select="data_problem">
95
                  <xsl:for-each select="paragraph"/>
96
                    <xsl:value-of select="."/><br/>
97
                  </xsl:for-each>
98
                </xsl:for-each>
99
                <xsl:text><![CDATA[&nbsp;]]></xsl:text></td>
100
          </tr>
101
          </xsl:for-each>
102
        </table>
103
      </body>
104
    </html>
105
  </xsl:template>
106

  
107
  <xsl:template match="meta_file_id">
108
    <table>
109
      <tr>
110
        <td class="shaded">
111
          <b><xsl:text>Metadata File ID:</xsl:text></b>
112
        </td>
113
        <td>
114
          <xsl:value-of select="."/>
115
        </td>
116
      </tr>
117
    </table>
118
  </xsl:template>
119

  
120
  <xsl:template match="format">
121
    <xsl:choose>
122
       <xsl:when test="compressed">Compressed - <xsl:value-of select="compressed"/></xsl:when>
123
       <xsl:when test="encoded">Encoded - <xsl:value-of select="encoded"/></xsl:when>
124
       <xsl:when test="base_file_type/ASCII">ASCII file <xsl:value-of select="record_delimiter"/></xsl:when>
125
       <xsl:when test="base_file_type/binary">Binary file</xsl:when>
126
     </xsl:choose>
127
  </xsl:template>
128

  
129
  <xsl:template match="orientation">
130
    <xsl:choose>
131
      <xsl:when test="@columnorrow='columnmajor'">File column is major</xsl:when>
132
      <xsl:when test="@columnorrow='rowmajor'">File row is major</xsl:when>
133
     </xsl:choose>
134
  </xsl:template>
135

  
136
  <xsl:template match="case_sensitive">
137
    <xsl:choose>
138
      <xsl:when test="@yesorno='n'">No case sensitive fields</xsl:when>
139
      <xsl:when test="@yesorno='y'">Fields are case sensitive</xsl:when>
140
    </xsl:choose>
141
  </xsl:template>
142

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

  
153
</xsl:stylesheet> 
0 154

  

Also available in: Unified diff