Project

General

Profile

« Previous | Next » 

Revision 432

Added by berkley about 24 years ago

style sheet for resource documents

View differences:

lib/style/resource.xsl
1
<?xml version="1.0"?>
2
<!--
3
  * marine.xsl
4
  *
5
  *      Authors: Chad Berkley
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 July 20
10
  *    File Info: '$Id$'  
11
  *
12
-->
13
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
14
  <xsl:output method="html" />
15
  <xsl:template match="/"> 
16
    <html>
17
    <head>
18
      <title>
19
        <xsl:value-of select="//title" />
20
      </title>
21
    </head>
22
    <body bgcolor="white">
23
      <h1><xsl:value-of select="//title" /></h1>
24
      <!-- display the literature specific fields if they are present -->
25
      <xsl:if test="count(resource/literature/ISBN) &gt; 0">
26
        <h2>ISBN: <xsl:value-of select="resource/literature/ISBN" /></h2>
27
      </xsl:if>
28
      <xsl:if test="count(resource/literature/editor) &gt; 0">
29
        <xsl:for-each select="resource/literature/editor">
30
          <h2>editor: <xsl:value-of select="resource/literature/editor" /></h2>
31
        </xsl:for-each>
32
      </xsl:if>
33
      <xsl:if test="count(resource/literature/edition) &gt; 0">
34
        <h2>edition: <xsl:value-of select="resource/literature/edition" /></h2>
35
      </xsl:if>
36
      <xsl:if test="count(resource/literature/volume) &gt; 0">
37
        <h2>volume: <xsl:value-of select="resource/literature/volume" /></h2>
38
      </xsl:if>
39
      <xsl:if test="count(resource/literature/ISBN) &gt; 0">
40
        <h2>ISBN: <xsl:value-of select="resource/literature/ISBN" /></h2>
41
      </xsl:if>
42
      
43
      <!-- display the dataset specific field if present -->
44
      <xsl:if test="count(resource/dataset/geoForm) &gt; 0">
45
        <h2>Data Form: <xsl:value-of select="resource/dataset/geoForm" /></h2>
46
      </xsl:if>
47
      
48
      <!-- display the contact information -->
49
      <u><h3>Contacts</h3></u>
50
      
51
      <xsl:for-each select="resource/*/originator">
52
        <xsl:value-of select="./individualName/salutation" />&nbsp;
53
        <xsl:value-of select="./individualName/givenName" />&nbsp;
54
        <xsl:value-of select="./individualName/surName" />&nbsp;
55
        <br />
56
        <b><xsl:value-of select="./roleCode" /></b><br/>
57
        <xsl:if test="count(resource/*/organizationName) &gt; 0">
58
          <xsl:value-of select="./organizationName" />
59
          <br />
60
        </xsl:if>
61
        
62
        <xsl:if test="count(./contactInfo/phone/voice) &gt; 0">
63
          Voice Number(s):&nbsp;
64
          <xsl:for-each select="./contactInfo/phone/voice">
65
           <xsl:value-of select="." />
66
            <br />
67
          </xsl:for-each>
68
        </xsl:if>
69
        
70
        <xsl:if test="count(./contactInfo/phone/facsimile) &gt; 0">
71
          Fax Number(s):&nbsp;
72
          <xsl:for-each select="./contactInfo/phone/facsimile">
73
            <xsl:value-of select="." />
74
            <br />
75
          </xsl:for-each>
76
        </xsl:if>
77
        
78
        <xsl:if test="count(./contactInfo/phone/other) &gt; 0">
79
          Other Number(s):&nbsp;
80
          <xsl:for-each select="./contactInfo/phone/other">
81
            <xsl:value-of select="." />
82
            &nbsp;&nbsp;
83
            <xsl:text>Number type:</xsl:text>
84
            <xsl:value-of select="/resource/*/*/contactInfo/phone/otherType" />
85
            <br />
86
          </xsl:for-each>
87
        </xsl:if>
88
        
89
        <xsl:if test="count(./contactInfo/address) &gt; 0">
90
          <xsl:value-of select="./contactInfo/address/deliveryPoint" /><br/>
91
          <xsl:value-of select="./contactInfo/address/city" />,&nbsp;
92
          <xsl:value-of select="./contactInfo/address/administrativeArea" />&nbsp;
93
          <xsl:value-of select="./contactInfo/address/postalCode" />&nbsp;<br/>
94
          <xsl:value-of select="./contactInfo/address/country" /><br/>
95
          <xsl:value-of select="./contactInfo/address/electronicMailAddress" />
96
          <br/>
97
        </xsl:if>
98
          
99
        <xsl:if test="count(./onlineResource) &gt; 0">
100
          <xsl:value-of select="./onlineResource/linkage/URL" /><br/>
101
          <xsl:value-of select="./onlineResource/protocol" /><br/>
102
          <xsl:value-of select="./onlineResource/applicationProtocol" /><br/>
103
          <xsl:value-of select="./onlineResource/linkage/name" /><br/>
104
          <xsl:value-of select="./onlineResource/linkage/description" /><br/>
105
          <xsl:value-of select="./onlineResource/linkage/functionCode" /><br/>
106
          <br />
107
        </xsl:if>
108
        
109
        <xsl:if test="count(./contactInfo/hoursOfService) &gt; 0">
110
          Office hourse: &nbsp;
111
          <xsl:value-of select="./contactInfo/hoursOfService" />
112
          <br/>
113
        </xsl:if>
114
        
115
        <xsl:if test="count(./contactInfo/contactInstructions) &gt; 0">
116
          Contact instructions:&nbsp;
117
          <xsl:value-of select="./contactInfo/contactInstructions" />
118
          <br/>
119
        </xsl:if>
120
        
121
        <hr />
122
      </xsl:for-each>
123
      
124
    </body>
125
    </html>
126
  </xsl:template>
127
</xsl:stylesheet>
0 128

  

Also available in: Unified diff