Project

General

Profile

metacat / lib / style / skins / metacatui / eml-2 / eml-party.xsl @ 8012

1
<?xml version="1.0"?>
2
<!--
3
  *  '$RCSfile$'
4
  *      Authors: Matthew Brooke
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: leinfelder $'
10
  *     '$Date: 2013-07-16 15:11:51 -0700 (Tue, 16 Jul 2013) $'
11
  * '$Revision: 8012 $'
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="UTF-8"
35
              doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
36
              doctype-system="http://www.w3.org/TR/html4/loose.dtd"
37
              indent="yes" />  
38

    
39
  <!-- This module is for party member and it is self contained-->
40

    
41
  <xsl:template name="party">
42
      <xsl:param name="partyfirstColStyle"/>
43
      <div class="row-fluid">
44
        <xsl:choose>
45
         <xsl:when test="references!=''">
46
          <xsl:variable name="ref_id" select="references"/>
47
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
48
          <xsl:for-each select="$references">
49
            <xsl:apply-templates mode="party">
50
             <xsl:with-param name="partyfirstColStyle" select="$partyfirstColStyle"/>
51
            </xsl:apply-templates>
52
          </xsl:for-each>
53
        </xsl:when>
54
        <xsl:otherwise>
55
          <xsl:apply-templates mode="party">
56
            <xsl:with-param name="partyfirstColStyle" select="$partyfirstColStyle"/>
57
          </xsl:apply-templates>
58
        </xsl:otherwise>
59
      </xsl:choose>
60
      </div>
61
  </xsl:template>
62

    
63
  <!-- *********************************************************************** -->
64

    
65

    
66
  <xsl:template match="individualName" mode="party">
67
      <xsl:param name="partyfirstColStyle"/>
68
      <xsl:if test="normalize-space(.)!=''">
69
        <div class="control-group">
70
        	<label class="control-label">Individual</label>
71
        	<div class="controls" >
72
	           <b><xsl:value-of select="./salutation"/><xsl:text> </xsl:text>
73
	           <xsl:value-of select="./givenName"/><xsl:text> </xsl:text>
74
	           <xsl:value-of select="./surName"/></b>
75
        	</div>
76
        </div>	
77
      </xsl:if>
78
  </xsl:template>
79

    
80

    
81
  <xsl:template match="organizationName" mode="party">
82
      <xsl:param name="partyfirstColStyle"/>
83
      <xsl:if test="normalize-space(.)!=''">
84
        <div class="control-group">
85
        	<label class="control-label">Organization</label>
86
        	<div class="controls">
87
        		<b><xsl:value-of select="."/></b>
88
        	</div>
89
        </div>
90
      </xsl:if>
91
  </xsl:template>
92

    
93

    
94
  <xsl:template match="positionName" mode="party">
95
      <xsl:param name="partyfirstColStyle"/>
96
      <xsl:if test="normalize-space(.)!=''">
97
      <div class="control-group">
98
        	<label class="control-label">Position</label>
99
        	<div class="controls">
100
        		<xsl:value-of select="."/>
101
        	</div>
102
       </div>
103
      </xsl:if>
104
  </xsl:template>
105

    
106

    
107
  <xsl:template match="address" mode="party">
108
    <xsl:param name="partyfirstColStyle"/>
109
    <xsl:if test="normalize-space(.)!=''">
110
      <xsl:call-template name="addressCommon">
111
         <xsl:with-param name="partyfirstColStyle" select="$partyfirstColStyle"/>
112
      </xsl:call-template>
113
    </xsl:if>
114
    </xsl:template>
115

    
116
   <!-- This template will be call by other place-->
117
   <xsl:template name="address">
118
      <xsl:param name="partyfirstColStyle"/>
119
        <xsl:choose>
120
         <xsl:when test="references!=''">
121
          <xsl:variable name="ref_id" select="references"/>
122
          <xsl:variable name="references" select="$ids[@id=$ref_id]" />
123
          <xsl:for-each select="$references">
124
            <xsl:call-template name="addressCommon">
125
             <xsl:with-param name="partyfirstColStyle" select="$partyfirstColStyle"/>
126
            </xsl:call-template>
127
          </xsl:for-each>
128
        </xsl:when>
129
        <xsl:otherwise>
130
          <xsl:call-template name="addressCommon">
131
             <xsl:with-param name="partyfirstColStyle" select="$partyfirstColStyle"/>
132
          </xsl:call-template>
133
        </xsl:otherwise>
134
      </xsl:choose>
135
  </xsl:template>
136

    
137
   <xsl:template name="addressCommon">
138
    <xsl:param name="partyfirstColStyle"/>
139
    <xsl:if test="normalize-space(.)!=''">
140
    <div class="control-group">
141
    	<label class="control-label">Address</label>
142
    	<div class="controls">
143
    		<address>
144
			    <xsl:for-each select="deliveryPoint">
145
			    	<xsl:value-of select="."/><xsl:text>, </xsl:text>
146
			    </xsl:for-each>
147
			    <br/>
148
			    <!-- only include comma if city exists... -->
149
			    <xsl:if test="normalize-space(city)!=''">
150
			        <xsl:value-of select="city"/><xsl:text>, </xsl:text>
151
			    </xsl:if>
152
			    <xsl:if test="normalize-space(administrativeArea)!='' or normalize-space(postalCode)!=''">
153
			        <xsl:value-of select="administrativeArea"/><xsl:text> </xsl:text><xsl:value-of select="postalCode"/><xsl:text> </xsl:text>
154
			    </xsl:if>
155
			    <xsl:if test="normalize-space(country)!=''">
156
			      <xsl:value-of select="country"/>
157
			    </xsl:if>
158
    		</address>
159
		</div> 
160
	</div>
161
    </xsl:if>
162
   </xsl:template>
163

    
164
  <xsl:template match="phone" mode="party">
165
      <xsl:param name="partyfirstColStyle"/>
166
      <div class="control-group">
167
      	<label class="control-label">Phone</label>
168
          <div class="controls">
169
             <xsl:value-of select="."/>
170
             <xsl:if test="normalize-space(./@phonetype)!=''">
171
               <xsl:text> (</xsl:text><xsl:value-of select="./@phonetype"/><xsl:text>)</xsl:text>
172
             </xsl:if>
173
          </div>
174
      </div>
175
  </xsl:template>
176

    
177

    
178
  <xsl:template match="electronicMailAddress" mode="party">
179
      <xsl:param name="partyfirstColStyle"/>
180
      <xsl:if test="normalize-space(.)!=''">
181
       <div class="control-group">
182
       	<label class="control-label" >
183
            Email Address
184
          </label>
185
          <div class="controls">
186
            <a><xsl:attribute name="href">mailto:<xsl:value-of select="."/></xsl:attribute>
187
                    <xsl:value-of select="."/></a>
188
          </div>
189
       </div>
190

    
191
      </xsl:if>
192
  </xsl:template>
193

    
194

    
195
  <xsl:template match="onlineUrl" mode="party">
196
      <xsl:param name="partyfirstColStyle"/>
197
      <xsl:if test="normalize-space(.)!=''">
198
      <div class="control-group">
199
      	<label class="control-label">Web Address</label>
200
        <div class="controls">
201
            <a><xsl:attribute name="href"><xsl:value-of select="."/></xsl:attribute>
202
            <xsl:value-of select="."/></a>
203
       	</div>
204
      </div>
205
    </xsl:if>
206
  </xsl:template>
207

    
208

    
209
  <xsl:template match="userId" mode="party">
210
      <xsl:param name="partyfirstColStyle"/>
211
      <xsl:if test="normalize-space(.)!=''">
212
      <div class="control-group">
213
      	<label class="control-label">Id</label>
214
      	<div class="controls">
215
        	<xsl:value-of select="."/>
216
        </div>
217
       </div>
218
      </xsl:if>
219
  </xsl:template>
220
  <xsl:template match="text()" mode="party" />
221
</xsl:stylesheet>