aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/exslt/index.html
blob: 4e255e101f2ea0385ddb409dbf7b5c2bfe478378 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
---
title: EXSLT
slug: Web/EXSLT
tags:
  - EXSLT
  - NeedsTranslation
  - TopicStub
  - XSLT
  - XSLT_Reference
translation_of: Web/EXSLT
---
<p>
{{ XsltRef() }}
EXSLT is a set of extensions to <a href="en/XSLT">XSLT</a>. There are a number of modules; those that are supported by Firefox are listed below:
</p>
<dl><dt><a href="#Common">Common</a> (<code>exsl</code>)
</dt><dd>Provides basic extension elements and functions.
</dd><dt><a href="#Math">Math</a> (<code>math</code>)
</dt><dd>Provides routines for comparing nodes.
</dd><dt><a href="#Regular_expressions">Regular expressions</a> (<code>regexp</code>)
</dt><dd>Provides facilities for using regular expressions in JavaScript syntax.
</dd><dt><a href="#Sets">Sets</a> (<code>set</code>)
</dt><dd>Provides routines for manipulating sets.
</dd><dt><a href="#Strings">Strings</a> (<code>str</code>)
</dt><dd>Provides functions for string manipulation.
</dd></dl>
<h3 id="Using_EXSLT" name="Using_EXSLT">Using EXSLT</h3>
<p>To use an EXSLT function, you need to declare the namespace the function is in, and then use the appropriate prefix when calling the function. For example, to use the regular expressions package:
</p>
<pre class="eval">&lt;xsl:stylesheet version="1.0"
                xmlns:xsl="<span class="nowiki">http://www.w3.org/1999/XSL/Transform</span>"
                xmlns:regexp="<span class="nowiki">http://exslt.org/regular-expressions</span>"&gt;
  &lt;xsl:template match="/"&gt;
    ...
    &lt;xsl:value-of select="regexp:replace(/root/@value, 'before', 'gi', 'AFTER')"/&gt;
    ...
  &lt;/xsl:template&gt;

&lt;/xsl:stylesheet&gt;
</pre>
<h3 id="Common" name="Common">Common</h3>
<p>The EXSLT Common package provides basic functions that expand upon the capabilities of XSLT. The namespace for the Common package is <code><span class="nowiki">http://exslt.org/common</span></code>.
</p>
<h4 id="Functions" name="Functions"> Functions </h4>
<ul><li> <a href="en/EXSLT/exsl/node-set">exsl:node-set</a>
</li><li> <a href="en/EXSLT/exsl/object-type">exsl:object-type</a>
</li></ul>
<h3 id="Math" name="Math">Math</h3>
<p>The EXSLT Math package provides functions for working with numeric values and comparing nodes. The namespace for the Math package is <code><span class="nowiki">http://exslt.org/math</span></code>.
</p>
<h4 id="Functions_2" name="Functions_2">Functions</h4>
<ul><li> <a href="en/EXSLT/math/highest">math:highest</a>
</li><li> <a href="en/EXSLT/math/lowest">math:lowest</a>
</li><li> <a href="en/EXSLT/math/max">math:max</a>
</li><li> <a href="en/EXSLT/math/min">math:min</a>
</li></ul>
<h3 id="Regular_expressions" name="Regular_expressions">Regular expressions</h3>
<p>The EXSLT Regular Expressions package provides functions that allow testing, matching, and replacing text using JavaScript style regular expressions.
</p><p>The EXSLT Regular Expressions namespace is <code><span class="nowiki">http://exslt.org/regular-expressions</span></code>.
</p>
<h4 id="Functions_3" name="Functions_3">Functions</h4>
<ul><li> <a href="en/EXSLT/regexp/match">regexp:match</a>
</li><li> <a href="en/EXSLT/regexp/replace">regexp:replace</a>
</li><li> <a href="en/EXSLT/regexp/test">regexp:test</a>
</li></ul>
<h3 id="Sets" name="Sets">Sets</h3>
<p>The EXSLT Sets package offers functions that let you perform set manipulation. The namespace for these functions is <code><span class="nowiki">http://exslt.org/sets</span></code>.
</p>
<h4 id="Functions_4" name="Functions_4">Functions</h4>
<ul><li> <a href="en/EXSLT/set/difference">set:difference</a>
</li><li> <a href="en/EXSLT/set/distinct">set:distinct</a>
</li><li> <a href="en/EXSLT/set/intersection">set:intersection</a>
</li><li> <a href="en/EXSLT/set/has-same-node">set:has-same-node</a>
</li><li> <a href="en/EXSLT/set/leading">set:leading</a>
</li><li> <a href="en/EXSLT/set/trailing">set:trailing</a>
</li></ul>
<h3 id="Strings" name="Strings">Strings</h3>
<p>The EXSLT Strings package provides functions that allow the manipulation of strings. The namespace for the Strings package is <code><span class="nowiki">http://exslt.org/strings</span></code>.
</p>
<h4 id="Functions_5" name="Functions_5">Functions</h4>
<ul><li> <a href="en/EXSLT/str/concat">str:concat</a>
</li><li> <a href="en/EXSLT/str/split">str:split</a>
</li><li> <a href="en/EXSLT/str/tokenize">str:tokenize</a>
</li></ul>
<h3 id="See_also" name="See_also">See also</h3>
<ul><li> <a class="external" href="http://www.exslt.org/">EXSLT web site</a>
</li></ul>
<p><br>
</p>
<div class="noinclude">
</div>
{{ languages( { "es": "es/EXSLT", "fr": "fr/EXSLT", "ja": "ja/EXSLT", "pl": "pl/EXSLT" } ) }}