geo_combine 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,97 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <xsl:stylesheet
3
+ version="1.0"
4
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
5
+ xmlns:xs="http://www.w3.org/2001/XMLSchema">
6
+
7
+ <xs:annotation>
8
+ <xs:documentation>
9
+ Convert string-based enumerations within a schema to regular
10
+ expressions which allow any combination of capitalization. Original
11
+ version of this stylesheet obtained from:
12
+ http://www.ibm.com/developerworks/xml/library/x-case/
13
+ </xs:documentation>
14
+ </xs:annotation>
15
+
16
+ <xsl:template match="*|@*|text()">
17
+ <xsl:copy>
18
+ <xsl:apply-templates select="*|@*|text()"/>
19
+ </xsl:copy>
20
+ </xsl:template>
21
+
22
+ <xsl:template match="xs:restriction[@base='xs:string']
23
+ [count(xs:enumeration) &gt; 0]">
24
+ <xs:restriction base="xs:string">
25
+ <xs:pattern>
26
+ <xsl:attribute name="value">
27
+ <xsl:for-each select="xs:enumeration">
28
+
29
+ <!-- Step 1. Write a left parenthesis -->
30
+ <xsl:text>(</xsl:text>
31
+
32
+ <!-- Step 2. Write the upper- and lowercase letters -->
33
+ <xsl:call-template name="case-insensitive-pattern">
34
+ <xsl:with-param name="index" select="1"/>
35
+ <xsl:with-param name="string" select="@value"/>
36
+ </xsl:call-template>
37
+
38
+ <!-- Step 3. Write a right parenthesis -->
39
+ <xsl:text>)</xsl:text>
40
+
41
+ <!-- Step 4. If this isn't the last enumeration, write -->
42
+ <!-- a vertical bar -->
43
+ <xsl:if test="not(position()=last())">
44
+ <xsl:text>|</xsl:text>
45
+ </xsl:if>
46
+ </xsl:for-each>
47
+ </xsl:attribute>
48
+ </xs:pattern>
49
+ </xs:restriction>
50
+ </xsl:template>
51
+
52
+ <xsl:template name="case-insensitive-pattern">
53
+ <xsl:param name="string"/>
54
+ <xsl:param name="index"/>
55
+
56
+ <xsl:variable name="current-letter">
57
+ <!-- Write a left parenthesis -->
58
+ <xsl:text>(</xsl:text>
59
+
60
+ <!-- Convert the current letter to uppercase -->
61
+ <xsl:value-of select="translate(substring($string, $index, 1),
62
+ 'abcdefghijklmnopqrstuvwxyz',
63
+ 'ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
64
+
65
+ <!-- Write a vertical bar -->
66
+ <xsl:text>|</xsl:text>
67
+
68
+ <!-- Convert the current letter to lowercase -->
69
+ <xsl:value-of select="translate(substring($string, $index, 1),
70
+ 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
71
+ 'abcdefghijklmnopqrstuvwxyz')"/>
72
+
73
+ <!-- Write a right parenthesis -->
74
+ <xsl:text>)</xsl:text>
75
+ </xsl:variable>
76
+
77
+ <xsl:variable name="remaining-letters">
78
+
79
+ <!-- If $index is less than the length of the string, -->
80
+ <!-- call the template again. -->
81
+ <xsl:if test="$index &lt; string-length($string)">
82
+ <xsl:call-template name="case-insensitive-pattern">
83
+
84
+ <!-- The string parameter doesn't change -->
85
+ <xsl:with-param name="string" select="$string"/>
86
+
87
+ <!-- Increment the index of the current letter by 1 -->
88
+ <xsl:with-param name="index" select="$index+1"/>
89
+ </xsl:call-template>
90
+ </xsl:if>
91
+ </xsl:variable>
92
+
93
+ <!-- Finally, we output the concatenated values -->
94
+ <xsl:value-of select="concat($current-letter, $remaining-letters)"/>
95
+ </xsl:template>
96
+
97
+ </xsl:stylesheet>
@@ -0,0 +1,73 @@
1
+ <!--
2
+
3
+ convert-latlong.xsl
4
+
5
+ Author: John Maurer (jmaurer@hawaii.edu)
6
+ Date: June 2007 (when I was at National Snow and Ice Data Center)
7
+
8
+ This Extensible Stylesheet Language for Transformations (XSLT) document
9
+ converts a latitude or longitude decimal value from positive and negative
10
+ numbers (e.g. 180, 89.2, -180, -89.2) to strings that indicate the
11
+ hemisphere (e.g. 180 E, 89.2 N, 180 W, 89.2 S). A zero value is returned
12
+ unchanged (e.g. 0).
13
+
14
+ You can import this XSLT in other XSLT files to call the "convert-latlong"
15
+ template for accomplishing this. Here is an example import statement:
16
+
17
+ <xsl:import href="convert-latlong.xsl"/>
18
+
19
+ For more information on XSLT see:
20
+
21
+ http://en.wikipedia.org/wiki/XSLT
22
+ http://www.w3.org/TR/xslt
23
+
24
+ -->
25
+
26
+ <xsl:stylesheet
27
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
28
+ version="1.0">
29
+
30
+ <xsl:output method="text"/>
31
+
32
+ <!-- This template converts latitude and longitude values from positive
33
+ and negative integers (e.g. 180, 90, -180, -90) to strings that
34
+ indicate the hemisphere (e.g. 180 E, 90 N, 180 W, 90 S). A zero
35
+ value is returned unchanged (e.g. 0): -->
36
+
37
+ <xsl:template name="convert-latlong">
38
+ <xsl:param name="latitude"/>
39
+ <xsl:param name="longitude"/>
40
+ <xsl:param name="value"/>
41
+ <xsl:choose>
42
+ <xsl:when test="$latitude">
43
+ <xsl:choose>
44
+ <xsl:when test="number( $value ) &gt; 1">
45
+ <xsl:value-of select="concat( $value, ' N' )"/>
46
+ </xsl:when>
47
+ <xsl:when test="number( $value ) &lt; 1">
48
+ <xsl:value-of select="concat( substring-after( $value, '-' ), ' S' )"/>
49
+ </xsl:when>
50
+ <!-- If zero, just return the value: -->
51
+ <xsl:otherwise>
52
+ <xsl:value-of select="$value"/>
53
+ </xsl:otherwise>
54
+ </xsl:choose>
55
+ </xsl:when>
56
+ <xsl:when test="$longitude">
57
+ <xsl:choose>
58
+ <xsl:when test="number( $value ) &gt; 1">
59
+ <xsl:value-of select="concat( $value, ' E' )"/>
60
+ </xsl:when>
61
+ <xsl:when test="number( $value ) &lt; 1">
62
+ <xsl:value-of select="concat( substring-after( $value, '-' ), ' W' )"/>
63
+ </xsl:when>
64
+ <!-- If zero, just return the value: -->
65
+ <xsl:otherwise>
66
+ <xsl:value-of select="$value"/>
67
+ </xsl:otherwise>
68
+ </xsl:choose>
69
+ </xsl:when>
70
+ </xsl:choose>
71
+ </xsl:template>
72
+
73
+ </xsl:stylesheet>
@@ -0,0 +1,408 @@
1
+ /* box model */
2
+
3
+ BODY {
4
+ margin: 1em;
5
+ }
6
+
7
+ H1 {
8
+ padding: 0.3em 0.5em 0.3em 0.5em;
9
+ margin: 0em;
10
+ }
11
+
12
+ H2 {
13
+ padding: 0.2em 1em 0.2em 0.8em;
14
+ margin: 1em 0em 0em 0em;
15
+ }
16
+
17
+ H3 {
18
+ padding: 0.1em 1em 0.2em 0.8em;
19
+ margin: 0em;
20
+ }
21
+
22
+ H4 {
23
+ padding: 0em;
24
+ margin: 0.5em 1em;
25
+ }
26
+
27
+ H5 {
28
+ padding: 0em;
29
+ margin: 0em 1em;
30
+ }
31
+
32
+ P, TABLE {
33
+ margin: 0.5em 1em;
34
+ }
35
+
36
+ UL, OL {
37
+ margin: 0.5em 2em;
38
+ }
39
+
40
+ UL UL, UL OL, OL UL, OL OL {
41
+ margin: 0.5em 0em;
42
+ }
43
+
44
+ TD.implementations UL {
45
+ margin: 0.5em 0em;
46
+ }
47
+
48
+ TD.implementations LI {
49
+ margin: 0em 2em;
50
+ }
51
+
52
+ LI {
53
+ margin: 0.5em 2em;
54
+ list-style-type: disc;
55
+ }
56
+
57
+ LI P {
58
+ margin: 0em;
59
+ }
60
+
61
+ DL {
62
+ margin: 0.5em 2em 1em 2em;
63
+ }
64
+
65
+ DT {
66
+ margin: 1em;
67
+ clear: both;
68
+ }
69
+
70
+ DD {
71
+ margin: -0.5em 0em -0.5em 2em;
72
+ }
73
+
74
+ DD UL, DD OL {
75
+ margin-left: 0em;
76
+ }
77
+
78
+ BLOCKQUOTE {
79
+ margin-left: 3em;
80
+ }
81
+
82
+ IMG {
83
+ position: relative;
84
+ }
85
+
86
+ TABLE {
87
+ width: 100%;
88
+ margin: 0em;
89
+ }
90
+
91
+ PRE {
92
+ padding: 0.5em 3em 0.5em 3em;
93
+ margin: 0em;
94
+ }
95
+
96
+ #content TD PRE {
97
+ padding: 0em;
98
+ }
99
+
100
+ PRE.copyright {
101
+ padding: 0em;
102
+ margin: 0em;
103
+ }
104
+
105
+ .issue {
106
+ padding: 0em 3em;
107
+ margin: 0em;
108
+ }
109
+
110
+ #menu {
111
+ width: 20%;
112
+ padding: 0em;
113
+ }
114
+
115
+ P.level1, P.level2, P.level3, P.level4 {
116
+ padding: 0em 1em;
117
+ margin: 0em;
118
+ }
119
+
120
+ P.level1 {
121
+ margin: 0em 0em 3px 0em;
122
+ }
123
+
124
+ P.level2 {
125
+ margin: 0em 0em 1px 0em;
126
+ }
127
+
128
+ P.level3 {
129
+ margin-left: 1em;
130
+ }
131
+
132
+ P.level4 {
133
+ margin-left: 2em;
134
+ }
135
+
136
+ #content TH, #content TD {
137
+ margin: 0em;
138
+ padding: 0em 0.5em;
139
+ }
140
+
141
+ #navigation, #content, #colophon P {
142
+ margin-top: 2px;
143
+ }
144
+
145
+ TD.implementations {
146
+ width: 25%;
147
+ }
148
+
149
+ /* fonts */
150
+ BODY, TR {
151
+ font-family: 'Trebuchet MS', Arial, sans-serif;
152
+ }
153
+
154
+ H1, H2, H3, H4, H5, H6 {
155
+ font-family: 'Trebuchet MS', Arial, sans-serif;
156
+ }
157
+
158
+ H1 {
159
+ font-size: 173%;
160
+ font-weight: bold;
161
+ }
162
+
163
+ H2 {
164
+ font-size: 120%;
165
+ font-weight: bold;
166
+ }
167
+
168
+ H3 {
169
+ font-size: 120%;
170
+ font-weight: bold;
171
+ }
172
+
173
+ H4 {
174
+ font-size: 100%;
175
+ font-weight: bold;
176
+ }
177
+
178
+ H5 {
179
+ font-size: 100%
180
+ font-weight: normal;
181
+ font-style: italic;
182
+ }
183
+
184
+ #navigation TD {
185
+ font-weight: bold;
186
+ }
187
+
188
+ DT {
189
+ font-weight: bold;
190
+ }
191
+
192
+ PRE, CODE {
193
+ font-size: 100%;
194
+ }
195
+
196
+ A:link, A:visited, A:active, A:hover {
197
+ font-weight: bold;
198
+ }
199
+
200
+ A.offsite:link, A.offsite:visited, A.offsite:active, A.offsite:hover {
201
+ font-weight: normal;
202
+ }
203
+
204
+ #menu P.level1, P.level1 A:link, P.level1 A:visited, P.level1 A:hover {
205
+ font-weight: bold;
206
+ }
207
+
208
+ #menu P.level2, P.level2 A:link, P.level2 A:visited {
209
+ font-weight: normal;
210
+ }
211
+
212
+ #menu P.level3, P.level3 A:link, P.level3 A:visited {
213
+ font-weight: normal;
214
+ }
215
+
216
+ #menu P.level3, #menu P.level4 {
217
+ font-size: 83%;
218
+ }
219
+
220
+ #menu P.level4, P.level4 A:link, P.level4 A:visited {
221
+ font-weight: normal;
222
+ font-style: italic;
223
+ }
224
+
225
+ .note {
226
+ font-family: 'Trebuchet MS', Arial, sans-serif;
227
+ font-size: 100%;
228
+ font-style: italic;
229
+ }
230
+
231
+ #colophon {
232
+ font-size: 69%;
233
+ }
234
+
235
+ /* colours */
236
+ BODY {
237
+ background: white;
238
+ color: black;
239
+ border: 0px none white;
240
+ }
241
+
242
+ /* this is to make Navigator fill the entire line */
243
+ H1, #content {
244
+ border: 1px solid white;
245
+ width: 100%;
246
+ }
247
+
248
+ H1, H1 A:link, H1 A:visited, H1 A:active, H1 A:hover {
249
+ background: #401;
250
+ color: white;
251
+ }
252
+
253
+ H2 {
254
+ border-top: 5px solid white;
255
+ width: 100%;
256
+ }
257
+
258
+ H2, H2 A:link, H2 A:visited, H2 A:active, H2 A:hover {
259
+ background: #041;
260
+ color: white;
261
+ }
262
+
263
+
264
+ H3 {
265
+ border-top: 3px solid white;
266
+ width: 100%;
267
+ }
268
+
269
+ H3, H3 A:link, H3 A:visited, H3 A:active, H3 A:hover {
270
+ color: #041;
271
+ background: #EFE;
272
+ }
273
+
274
+ #content TABLE {
275
+ border-collapse: collapse;
276
+ }
277
+
278
+ #content TH {
279
+ background: #041;
280
+ color: white;
281
+ }
282
+
283
+ #content TD {
284
+ background: #EFE;
285
+ color: black;
286
+ border: 1px solid #041;
287
+ }
288
+
289
+ #content, #navigation {
290
+ background: #EFE;
291
+ color: black;
292
+ }
293
+
294
+ HR {
295
+ color: #041;
296
+ background: #041;
297
+ }
298
+
299
+ IMG, A:link IMG, A:visited IMG, A:hover IMG, A:active IMG {
300
+ border: 0px none white;
301
+ background: transparent;
302
+ }
303
+
304
+ A:link, A:visited, A:active, A:hover {
305
+ color: #052;
306
+ background: transparent;
307
+ border: 0px none white;
308
+ }
309
+
310
+ .note {
311
+ color: #333;
312
+ }
313
+
314
+ .note A:link, .note A:visited, .note A:hover {
315
+ background: transparent;
316
+ color: #041;
317
+ }
318
+
319
+ .error {
320
+ color: #C00;
321
+ }
322
+
323
+ #colophon {
324
+ color: #333;
325
+ background: #FEE;
326
+ }
327
+
328
+ #colophon A:link, #colophon A:visited, #colophon A:hover {
329
+ color: #401;
330
+ background: transparent;
331
+ }
332
+
333
+ TD.implementations {
334
+ border-left: 1px solid #041;
335
+ }
336
+
337
+ #menu {
338
+ background: #EEF;
339
+ color: #014;
340
+ }
341
+
342
+ #menu P.level1, P.level1 A:link, P.level1 A:visited, P.level1 A:active P.level1 A:hover {
343
+ background: #014;
344
+ color: white;
345
+ }
346
+
347
+ #menu P.level2, P.level2 A:link, P.level2 A:visited, P.level2 A:active P.level2 A:hover,
348
+ #menu P.level3, P.level3 A:link, P.level3 A:visited, P.level3 A:active P.level3 A:hover,
349
+ #menu P.level4, P.level4 A:link, P.level4 A:visited, P.level4 A:active P.level4 A:hover {
350
+ background: #EEF;
351
+ color: #014;
352
+ }
353
+
354
+
355
+ P.level2 A:hover, P.level3 A:hover, P.level4 A:hover {
356
+ text-decoration: underline;
357
+ }
358
+
359
+
360
+ /* text */
361
+ OL OL LI {
362
+ list-style: lower-alpha;
363
+ }
364
+
365
+ TH {
366
+ text-align: left;
367
+ }
368
+
369
+ TD {
370
+ vertical-align: top;
371
+ }
372
+
373
+ #content TH, #content TD {
374
+ text-align: center;
375
+ }
376
+
377
+ #content TH.rowhead, #content TD.rowhead {
378
+ text-align: left;
379
+ }
380
+
381
+ H1 {
382
+ text-transform: uppercase;
383
+ }
384
+
385
+ H2 {
386
+ text-transform: uppercase;
387
+ }
388
+
389
+ H4 {
390
+ text-transform: lowercase;
391
+ }
392
+
393
+ #menu {
394
+ text-transform: lowercase;
395
+ }
396
+
397
+ #navigation TD {
398
+ text-transform: uppercase;
399
+ text-align: center;
400
+ }
401
+
402
+ A.offsite {
403
+ text-decoration: underline;
404
+ }
405
+
406
+ A, A.function, A.element {
407
+ text-decoration: none;
408
+ }
@@ -0,0 +1,29 @@
1
+ <?xml version="1.0" encoding="ISO-8859-1"?>
2
+ <!DOCTYPE html
3
+ PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "/schema/xhtml1-strict.dtd">
4
+ <html xmlns="http://www.w3.org/1999/xhtml" xmlns:html="http://www.w3.org/1999/xhtml"><head><title>EXSLT - Strings</title><link rel="stylesheet" href="base.css"/></head><body><h1 id="#title"><a href="http://www.exslt.org/">EXSLT</a> - <a href="http://www.exslt.org/str/">Strings</a></h1><table><tr><td id="menu"><p class="level1"><a href="str.html">Implementer Page</a></p><p class="level1"><a href="../howto.html">How To</a></p><p class="level1"><a href="../download.html">Downloads</a></p><p class="level1">Modules</p><p class="level2"><a href="../date/index.html">Dates and Times</a></p><p class="level2"><a href="../dyn/index.html">Dynamic</a></p><p class="level2"><a href="../exsl/index.html">Common</a></p><p class="level2"><a href="../func/index.html">Functions</a></p><p class="level2"><a href="../math/index.html">Math</a></p><p class="level2"><a href="../random/index.html">Random</a></p><p class="level2"><a href="../regexp/index.html">Regular Expressions</a></p><p class="level2"><a href="../set/index.html">Sets</a></p><p class="level2"><a href="../str/index.html">Strings</a></p><p class="level3"><a href="functions/align/index.html">str:align()</a></p><p class="level3"><a href="functions/concat/index.html">str:concat()</a></p><p class="level3"><a href="functions/decode-uri/index.html">str:decode-uri()</a></p><p class="level3"><a href="functions/encode-uri/index.html">str:encode-uri()</a></p><p class="level3"><a href="functions/padding/index.html">str:padding()</a></p><p class="level3"><a href="functions/replace/index.html">str:replace()</a></p><p class="level3"><a href="functions/split/index.html">str:split()</a></p><p class="level3"><a href="functions/tokenize/index.html">str:tokenize()</a></p><p class="level1"><a href="../submissions/">Submissions</a></p><p class="level1"><a href="../list">Mailing List</a></p><p class="level1"><a href="../contact.html">Contact</a></p></td><td id="content"><p><b>Implementer Page: </b><a href="str.html">str.html</a><br/><b><a href="../howto.html#module-level">Module Package</a>: </b><a href="str.zip">str.zip</a></p><p>
5
+ EXSLT - Strings covers extension elements and functions that provide facilities to do with string manipulation.
6
+ </p><p>
7
+ XSLT processors may support any number of the extension elements and functions given in this module.
8
+ </p><p class="note">
9
+ Using EXSLT will only make your stylesheet portable amongst the implementations that support EXSLT. Note that there is no requirement for XSLT processors that are compliant to XSLT to support the extensions described within EXSLT.
10
+ </p><h2>Namespace</h2><p>
11
+ The namespace for EXSLT - Strings is:
12
+ </p><pre>http://exslt.org/strings</pre><p>
13
+ Throughout this document, the prefix <code>str</code> is used to refer to this namespace. Any other prefix can be used within a particular stylesheet (though a prefix must be specified to enable the extension functions to be recognised as extensions).
14
+ </p><p>
15
+ To use these extensions, you need to declare this namespace as an extension namespace in your stylesheet. If your processor supports this module, then that's all you need to do, but if it doesn't, then you need to use a specific third-party implementation or the module stylesheet. Typically, your stylesheet will look like:
16
+ </p><pre>
17
+ &lt;xsl:stylesheet version="1.0"
18
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
19
+ xmlns:str="http://exslt.org/strings"
20
+ extension-element-prefixes="str"&gt;
21
+
22
+ &lt;xsl:import href="str.xsl" /&gt;
23
+
24
+ ...
25
+
26
+ &lt;/xsl:stylesheet&gt;
27
+ </pre><h2>Functions</h2><h3>Other Functions</h3><p>
28
+ The following extension functions are not considered stable and are not part of the core of EXSLT - Strings. Processors that claim support of EXSLT - Strings might not support these functions.
29
+ </p><table><tr><th class="rowhead">Function</th><th>Syntax</th><th>Download</th></tr><tr><td class="rowhead"><a href="functions/tokenize/index.html">str:tokenize</a></td><td style="text-align: left;"><var>node-set</var> <b>str:tokenize</b>(<var>string</var>, <var>string</var>?)</td><td><a href="functions/tokenize/str.tokenize.zip">str.tokenize.zip</a></td></tr><tr><td class="rowhead"><a href="functions/replace/index.html">str:replace</a></td><td style="text-align: left;"><var>node-set</var> <b>str:replace</b>(<var>string</var>, <var>object</var>, <var>object</var>)</td><td><a href="functions/replace/str.replace.zip">str.replace.zip</a></td></tr><tr><td class="rowhead"><a href="functions/padding/index.html">str:padding</a></td><td style="text-align: left;"><var>string</var> <b>str:padding</b>(<var>number</var>, <var>string</var>?)</td><td><a href="functions/padding/str.padding.zip">str.padding.zip</a></td></tr><tr><td class="rowhead"><a href="functions/align/index.html">str:align</a></td><td style="text-align: left;"><var>string</var> <b>str:align</b>(<var>string</var>, <var>string</var>, <var>string</var>?)</td><td><a href="functions/align/str.align.zip">str.align.zip</a></td></tr><tr><td class="rowhead"><a href="functions/encode-uri/index.html">str:encode-uri</a></td><td style="text-align: left;"><var>string</var> <b>str:encode-uri</b>(<var>string</var>, <var>string</var>, <var>string</var>?)</td><td><a href="functions/encode-uri/str.encode-uri.zip">str.encode-uri.zip</a></td></tr><tr><td class="rowhead"><a href="functions/decode-uri/index.html">str:decode-uri</a></td><td style="text-align: left;"><var>string</var> <b>str:decode-uri</b>(<var>string</var>, <var>string</var>)</td><td><a href="functions/decode-uri/str.decode-uri.zip">str.decode-uri.zip</a></td></tr><tr><td class="rowhead"><a href="functions/concat/index.html">str:concat</a></td><td style="text-align: left;"><var>string</var> <b>str:concat</b>(<var>node-set</var>)</td><td><a href="functions/concat/str.concat.zip">str.concat.zip</a></td></tr><tr><td class="rowhead"><a href="functions/split/index.html">str:split</a></td><td style="text-align: left;"><var>node-set</var> <b>str:split</b>(<var>string</var>, <var>string</var>?)</td><td><a href="functions/split/str.split.zip">str.split.zip</a></td></tr></table></td></tr></table><div id="colophon"><p><a href="http://www.exslt.org/str/index.html">http://www.exslt.org/str/index.html</a> last modified 2001-11-18</p></div></body></html>