├── .gitattributes ├── .gitignore ├── .gitmodules ├── _build ├── all-functions.xsl ├── build.ps1 ├── ensure-nuget.ps1 ├── ensure-specs.ps1 ├── function.xsl └── restore-packages.ps1 ├── _config.yml ├── array ├── append.html ├── filter.html ├── flatten.html ├── fold-left.html ├── fold-right.html ├── for-each-pair.html ├── for-each.html ├── get.html ├── head.html ├── insert-before.html ├── join.html ├── put.html ├── remove.html ├── reverse.html ├── size.html ├── sort.html ├── subarray.html └── tail.html ├── css └── site.scss ├── favicon.ico ├── fn ├── QName.html ├── abs.html ├── adjust-date-to-timezone.html ├── adjust-dateTime-to-timezone.html ├── adjust-time-to-timezone.html ├── analyze-string.html ├── apply.html ├── available-environment-variables.html ├── avg.html ├── base-uri.html ├── boolean.html ├── ceiling.html ├── codepoint-equal.html ├── codepoints-to-string.html ├── collation-key.html ├── collection.html ├── compare.html ├── concat.html ├── contains-token.html ├── contains.html ├── count.html ├── current-date.html ├── current-dateTime.html ├── current-time.html ├── data.html ├── dateTime.html ├── day-from-date.html ├── day-from-dateTime.html ├── days-from-duration.html ├── deep-equal.html ├── default-collation.html ├── default-language.html ├── distinct-values.html ├── doc-available.html ├── doc.html ├── document-uri.html ├── element-with-id.html ├── empty.html ├── encode-for-uri.html ├── ends-with.html ├── environment-variable.html ├── error.html ├── escape-html-uri.html ├── exactly-one.html ├── exists.html ├── false.html ├── filter.html ├── floor.html ├── fold-left.html ├── fold-right.html ├── for-each-pair.html ├── for-each.html ├── format-date.html ├── format-dateTime.html ├── format-integer.html ├── format-number.html ├── format-time.html ├── function-arity.html ├── function-lookup.html ├── function-name.html ├── generate-id.html ├── has-children.html ├── head.html ├── hours-from-dateTime.html ├── hours-from-duration.html ├── hours-from-time.html ├── id.html ├── idref.html ├── implicit-timezone.html ├── in-scope-prefixes.html ├── index-of.html ├── innermost.html ├── insert-before.html ├── iri-to-uri.html ├── json-doc.html ├── json-to-xml.html ├── lang.html ├── last.html ├── load-xquery-module.html ├── local-name-from-QName.html ├── local-name.html ├── lower-case.html ├── matches.html ├── max.html ├── min.html ├── minutes-from-dateTime.html ├── minutes-from-duration.html ├── minutes-from-time.html ├── month-from-date.html ├── month-from-dateTime.html ├── months-from-duration.html ├── name.html ├── namespace-uri-for-prefix.html ├── namespace-uri-from-QName.html ├── namespace-uri.html ├── nilled.html ├── node-name.html ├── normalize-space.html ├── normalize-unicode.html ├── not.html ├── number.html ├── one-or-more.html ├── outermost.html ├── parse-ietf-date.html ├── parse-json.html ├── parse-xml-fragment.html ├── parse-xml.html ├── path.html ├── position.html ├── prefix-from-QName.html ├── random-number-generator.html ├── remove.html ├── replace.html ├── resolve-QName.html ├── resolve-uri.html ├── reverse.html ├── root.html ├── round-half-to-even.html ├── round.html ├── seconds-from-dateTime.html ├── seconds-from-duration.html ├── seconds-from-time.html ├── serialize.html ├── sort.html ├── starts-with.html ├── static-base-uri.html ├── string-join.html ├── string-length.html ├── string-to-codepoints.html ├── string.html ├── subsequence.html ├── substring-after.html ├── substring-before.html ├── substring.html ├── sum.html ├── tail.html ├── timezone-from-date.html ├── timezone-from-dateTime.html ├── timezone-from-time.html ├── tokenize.html ├── trace.html ├── transform.html ├── translate.html ├── true.html ├── unordered.html ├── unparsed-text-available.html ├── unparsed-text-lines.html ├── unparsed-text.html ├── upper-case.html ├── uri-collection.html ├── xml-to-json.html ├── year-from-date.html ├── year-from-dateTime.html ├── years-from-duration.html └── zero-or-one.html ├── github-btn.html ├── index.html ├── map ├── contains.html ├── entry.html ├── find.html ├── for-each.html ├── get.html ├── keys.html ├── merge.html ├── put.html ├── remove.html └── size.html ├── math ├── acos.html ├── asin.html ├── atan.html ├── atan2.html ├── cos.html ├── exp.html ├── exp10.html ├── log.html ├── log10.html ├── pi.html ├── pow.html ├── sin.html ├── sqrt.html └── tan.html ├── packages.config └── xpath-ref.sln /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.nuget/ 2 | /packages/ 3 | /_build/specs/ 4 | 5 | [Bb]in 6 | [Oo]bj 7 | [Tt]est[Rr]esults 8 | *.suo 9 | *.user 10 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "xmlspectrum"] 2 | path = xmlspectrum 3 | url = https://github.com/pgfearo/xmlspectrum 4 | [submodule "bootstrap-vertical-tabs"] 5 | path = bootstrap-vertical-tabs 6 | url = https://github.com/dbtek/bootstrap-vertical-tabs 7 | [submodule "bootstrap"] 8 | path = bootstrap 9 | url = https://github.com/twbs/bootstrap 10 | -------------------------------------------------------------------------------- /_build/build.ps1: -------------------------------------------------------------------------------- 1 | param([switch]$IndexOnly) 2 | 3 | $ErrorActionPreference = "Stop" 4 | Push-Location (Split-Path $script:MyInvocation.MyCommand.Path) 5 | 6 | try { 7 | 8 | $saxonPath = Resolve-Path ..\packages\Saxon-HE.* 9 | $indexOnlyXsd = $IndexOnly.ToString().ToLower() 10 | 11 | .\ensure-specs.ps1 12 | 13 | &"$saxonPath\tools\Transform" -s:.\specs\xpath-functions-31.xml -xsl:.\all-functions.xsl index-only=$indexOnlyXsd 14 | 15 | } finally { 16 | Pop-Location 17 | } -------------------------------------------------------------------------------- /_build/ensure-nuget.ps1: -------------------------------------------------------------------------------- 1 | $ErrorActionPreference = "Stop" 2 | Push-Location (Split-Path $script:MyInvocation.MyCommand.Path) 3 | 4 | $nuget = "..\.nuget\nuget.exe" 5 | 6 | try { 7 | 8 | $nugetDir = Split-Path $nuget 9 | 10 | if (-not (Test-Path $nugetDir -PathType Container)) { 11 | md $nugetDir | Out-Null 12 | } 13 | 14 | if (-not (Test-Path $nuget -PathType Leaf)) { 15 | write "Downloading NuGet..." 16 | Invoke-WebRequest https://www.nuget.org/nuget.exe -OutFile $nuget 17 | } 18 | 19 | } finally { 20 | Pop-Location 21 | } -------------------------------------------------------------------------------- /_build/ensure-specs.ps1: -------------------------------------------------------------------------------- 1 | $ErrorActionPreference = "Stop" 2 | Push-Location (Split-Path $script:MyInvocation.MyCommand.Path) 3 | 4 | $specs = @( 5 | "http://www.w3.org/TR/2017/REC-xpath-functions-31-20170321/xpath-functions-31.xml" 6 | , "http://www.w3.org/TR/2014/REC-xpath-functions-30-20140408/xpath-functions-30.xml" 7 | , "http://www.w3.org/TR/2010/REC-xpath-functions-20101214/xpath-functions-20101214.xml" 8 | , "https://www.w3.org/TR/2017/REC-xpath-31-20170321/xpath-31.xml" 9 | , "https://www.w3.org/TR/2017/REC-xpath-datamodel-31-20170321/xpath-datamodel-31.xml" 10 | , "http://www.w3.org/TR/2014/REC-xpath-datamodel-30-20140408/xpath-datamodel-30.xml" 11 | , "https://www.w3.org/TR/2017/REC-xslt-xquery-serialization-31-20170321/xslt-xquery-serialization-31.xml" 12 | ) 13 | 14 | try { 15 | 16 | if (-not (Test-Path specs -PathType Container)) { 17 | md specs | Out-Null 18 | } 19 | 20 | foreach ($url in $specs) { 21 | 22 | $fileName = Split-Path $url -Leaf 23 | 24 | if (-not (Test-Path .\specs\$fileName)) { 25 | write "Downloading $fileName" 26 | Invoke-WebRequest $url -OutFile .\specs\$fileName 27 | } 28 | } 29 | 30 | } finally { 31 | Pop-Location 32 | } -------------------------------------------------------------------------------- /_build/restore-packages.ps1: -------------------------------------------------------------------------------- 1 | $ErrorActionPreference = "Stop" 2 | Push-Location (Split-Path $script:MyInvocation.MyCommand.Path) 3 | 4 | $nuget = "..\.nuget\nuget.exe" 5 | 6 | try { 7 | 8 | ./ensure-nuget.ps1 9 | 10 | &$nuget restore ..\packages.config -SolutionDirectory .. 11 | 12 | } finally { 13 | Pop-Location 14 | } -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | title: XPath Reference 2 | exclude: [xpath-ref.sln, packages.config, xmlspectrum/, bootstrap/docs/] 3 | -------------------------------------------------------------------------------- /array/get.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | array:get 6 | 7 | 8 | 9 | 10 | 11 |
12 | 24 |
25 |
26 |
27 |

array:get

28 |
29 |

Returns the value at the specified position in the supplied array (counting from 1).

30 |
31 |
32 |

Signature

33 |
array:get(
34 |     $array as array(*), 
35 |     $position as xs:integer
36 | ) as item()*
37 |
38 |
39 |

Properties

40 |
41 |

This function is deterministic, context-independent, and focus-independent. 42 |

43 |
44 |
45 |
46 |

Rules

47 |
48 |

The result is the value of $array($position). 49 |

50 |
51 |
52 |
53 |

Error Conditions

54 |
55 |

A dynamic error occurs [ERRFOAY0001] if $position is not in the range 1 to 56 | array:size($array) inclusive. 57 |

58 |
59 |
60 |
61 |

Examples

62 |
63 |

The expression ["a", "b", "c"] => array:get(2) returns "b". 64 |

65 |

The expression ["a", ["b", "c"]] => array:get(2) returns ["b", "c"]. 66 |

67 |
68 | 75 |
76 | 79 | 80 | -------------------------------------------------------------------------------- /array/head.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | array:head 6 | 7 | 8 | 9 | 10 | 11 |
12 | 24 |
25 |
26 |
27 |

array:head

28 |
29 |

Returns the first member of an array, that is $array(1). 30 |

31 |
32 |
33 |

Signature

34 |
array:head($array as array(*)) as item()*
35 |
36 |
37 |

Properties

38 |
39 |

This function is deterministic, context-independent, and focus-independent. 40 |

41 |
42 |
43 |
44 |

Rules

45 |
46 |

The function returns first member of $array, that is the value of $array(1). 47 |

48 |
49 |
50 |
51 |

Error Conditions

52 |
53 |

A dynamic error occurs [ERRFOAY0001] if $array is empty. 54 |

55 |
56 |
57 |
58 |

Examples

59 |
60 |

The expression array:head([5, 6, 7, 8]) returns 5. 61 |

62 |

The expression array:head([["a", "b"], ["c", "d"]]) returns ["a", "b"]. 63 |

64 |

The expression array:head([("a", "b"), ("c", "d")]) returns "a", "b". 65 |

66 |
67 | 74 |
75 | 78 | 79 | -------------------------------------------------------------------------------- /array/reverse.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | array:reverse 6 | 7 | 8 | 9 | 10 | 11 |
12 | 24 |
25 |
26 |
27 |

array:reverse

28 |
29 |

Returns an array containing all the members of a supplied array, but in reverse order.

30 |
31 |
32 |

Signature

33 |
array:reverse($array as array(*)) as array(*)
34 |
35 |
36 |

Properties

37 |
38 |

This function is deterministic, context-independent, and focus-independent. 39 |

40 |
41 |
42 |
43 |

Rules

44 |
45 |

The function returns the result of the expression: 46 | array:join( fn:reverse(1 to array:size($array)) ! [$array(.)] )

47 |
48 |
49 |
50 |

Examples

51 |
52 |

The expression array:reverse(["a", "b", "c", "d"]) returns ["d", "c", "b", "a"]. 53 |

54 |

The expression array:reverse([("a", "b"), ("c", "d")]) returns [("c", "d"), ("a", "b")]. 55 |

56 |

The expression array:reverse([(1 to 5)]) returns [(1, 2, 3, 4, 5)]. 57 |

58 |

The expression array:reverse([]) returns []. 59 |

60 |
61 | 68 |
69 | 72 | 73 | -------------------------------------------------------------------------------- /array/size.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | array:size 6 | 7 | 8 | 9 | 10 | 11 |
12 | 24 |
25 |
26 |
27 |

array:size

28 |
29 |

Returns the number of members in the supplied array.

30 |
31 |
32 |

Signature

33 |
array:size($array as array(*)) as xs:integer
34 |
35 |
36 |

Properties

37 |
38 |

This function is deterministic, context-independent, and focus-independent. 39 |

40 |
41 |
42 |
43 |

Rules

44 |
45 |

If $array is empty the function returns zero. 46 |

47 |

Otherwise, the function returns the number of members in $array. 48 |

49 |
50 |
51 |
52 |

Notes

53 |
54 |

Note that because an array is an item, the fn:count function when applied to an array always returns 1 (one). 55 |

56 |
57 |
58 |
59 |

Examples

60 |
61 |

The expression array:size(["a", "b", "c"]) returns 3. 62 |

63 |

The expression array:size(["a", ["b", "c"]]) returns 2. 64 |

65 |

The expression array:size([ ]) returns 0. 66 |

67 |

The expression array:size([[ ]]) returns 1. 68 |

69 |
70 | 77 |
78 | 81 | 82 | -------------------------------------------------------------------------------- /array/tail.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | array:tail 6 | 7 | 8 | 9 | 10 | 11 |
12 | 24 |
25 |
26 |
27 |

array:tail

28 |
29 |

Returns an array containing all members except the first from a supplied array.

30 |
31 |
32 |

Signature

33 |
array:tail($array as array(*)) as array(*)
34 |
35 |
36 |

Properties

37 |
38 |

This function is deterministic, context-independent, and focus-independent. 39 |

40 |
41 |
42 |
43 |

Rules

44 |
45 |

The function returns an array containing all members of the supplied array except 46 | the first, 47 | that is array:remove($array, 1). 48 |

49 |
50 |
51 |
52 |

Error Conditions

53 |
54 |

A dynamic error occurs [ERRFOAY0001] if $array is empty. 55 |

56 |
57 |
58 |
59 |

Notes

60 |
61 |

If the supplied array contains exactly one member, the result will be an empty array.

62 |
63 |
64 |
65 |

Examples

66 |
67 |

The expression array:tail([5, 6, 7, 8]) returns [6, 7, 8]. 68 |

69 |

The expression array:tail([5]) returns [ ]. 70 |

71 |
72 | 79 |
80 | 83 | 84 | -------------------------------------------------------------------------------- /css/site.scss: -------------------------------------------------------------------------------- 1 | --- 2 | --- 3 | 4 | /* Layout */ 5 | body { 6 | margin: 10px 0; 7 | } 8 | 9 | .container { 10 | width: 1170px; 11 | max-width: 100%; 12 | } 13 | 14 | footer { 15 | margin-top: 10px; 16 | } 17 | 18 | .breadcrumb-col { 19 | padding-left: 0; 20 | padding-right: 0; 21 | } 22 | 23 | .search-col { 24 | padding-right: 0; 25 | } 26 | 27 | body.index #function-filters { 28 | padding-bottom: 10px; 29 | text-align: right; 30 | } 31 | 32 | body.index .tab-pane { 33 | padding-top: 10px; 34 | } 35 | 36 | body.index .tab-pane a.disabled { 37 | color: #aaa; 38 | cursor: not-allowed; 39 | } 40 | 41 | /* Style */ 42 | a, a:hover, a:focus { 43 | color: #00C; 44 | } 45 | 46 | .page-header { 47 | margin-top: 20px; 48 | } 49 | 50 | ol ol { 51 | list-style-type: lower-alpha; 52 | } 53 | 54 | .nav-tabs > li.active > a { 55 | font-weight: bold; 56 | } 57 | 58 | pre { 59 | background-color: #f8f8f8; 60 | border-color: #ddd; 61 | } 62 | 63 | code { 64 | background-color: rgba(0,0,0,0.04); 65 | color: #333; 66 | } 67 | 68 | code.signature span.function { font-weight: bold; } 69 | 70 | /* XMLSpectrum */ 71 | span.ww {background-color: #073642; } 72 | span.eq-equ, span.z, span.sc, span.scx, span.ec, span.es, span.ez, span.atneq {color: #0000ff; } 73 | span.ww:not(:hover), span.txt:not(:hover), span.cm:not(:hover), span.pi:not(:hover) { } 74 | span.txt, span.cd {color: #000; } 75 | span.literal {color: #b81414; } 76 | span.op, span.type-op, span.if, span.higher, span.step, span.whitespace, span.quantifier {color: blue; } 77 | span.function {color: #000; } 78 | span.fname, span.tname, span.tcall, span.vname, span.pname {color: #0000ff; } 79 | span.variable, span.external {color: #8e36d3; } 80 | span.qname, span.type-name, span.unclosed, span.en, span.cl, span.href {color: #b81414; } 81 | span.enxsl, span.clxsl, span.enx, span.filter, span.node {color: #268bd2; } 82 | span.parenthesis { color: #000; } 83 | span.atn, span.numeric, span.dt, span.axis, span.context, span.bracedq {color: #fd0000; } 84 | span.pi{ color: #b81414; } 85 | span.cm, span.comment, span.av {color: #0000ff; } 86 | span.type, span.node-type { color: #000; } 87 | -------------------------------------------------------------------------------- /favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/maxtoroq/xpath-ref/bb3b943040555866ade2537835d73ca003fdb913/favicon.ico -------------------------------------------------------------------------------- /fn/current-date.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fn:current-date 6 | 7 | 8 | 9 | 10 | 11 |
12 | 24 |
25 |
26 |
27 |

fn:current-date

28 |
29 |

Returns the current date.

30 |
31 |
32 |

Signature

33 |
fn:current-date() as xs:date
34 |
35 |
36 |

Properties

37 |
38 |

This function is deterministic, context-dependent, and focus-independent. It depends on 39 | implicit timezone. 40 | 41 |

42 |
43 |
44 |
45 |

Rules

46 |
47 |

Returns xs:date(fn:current-dateTime()). This is an xs:date 48 | (with timezone) that is current at some time during the evaluation of a query or 49 | transformation in which fn:current-date is executed. 50 |

51 |

This function is deterministic. The precise instant during the query 52 | or transformation represented by the value of fn:current-date is implementation-dependent. 53 |

54 |
55 |
56 |
57 |

Notes

58 |
59 |

The returned date will always have an associated timezone, which will always be the 60 | same 61 | as the implicit timezone in the dynamic context 62 |

63 |
64 |
65 |
66 |

Examples

67 |
68 |

fn:current-date() returns an xs:date corresponding to the 69 | current date. For example, a call of fn:current-date() might return 70 | 2004-05-12+01:00. 71 |

72 |
73 | 82 |
83 | 86 | 87 | -------------------------------------------------------------------------------- /fn/day-from-date.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fn:day-from-date 6 | 7 | 8 | 9 | 10 | 11 |
12 | 24 |
25 |
26 |
27 |

fn:day-from-date

28 |
29 |

Returns the day component of an xs:date. 30 |

31 |
32 |
33 |

Signature

34 |
fn:day-from-date($arg as xs:date?) as xs:integer?
35 |
36 |
37 |

Properties

38 |
39 |

This function is deterministic, context-independent, and focus-independent. 40 |

41 |
42 |
43 |
44 |

Rules

45 |
46 |

If $arg is the empty sequence, the function returns the empty sequence. 47 |

48 |

Otherwise, the function returns an xs:integer between 1 and 31, both 49 | inclusive, representing the day component in the localized value of 50 | $arg. 51 |

52 |
53 |
54 |
55 |

Examples

56 |
57 |

The expression fn:day-from-date(xs:date("1999-05-31-05:00")) returns 31. 58 |

59 |

The expression fn:day-from-date(xs:date("2000-01-01+05:00")) returns 1. 60 |

61 |
62 | 71 |
72 | 75 | 76 | -------------------------------------------------------------------------------- /fn/day-from-dateTime.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fn:day-from-dateTime 6 | 7 | 8 | 9 | 10 | 11 |
12 | 24 |
25 |
26 |
27 |

fn:day-from-dateTime

28 |
29 |

Returns the day component of an xs:dateTime. 30 |

31 |
32 |
33 |

Signature

34 |
fn:day-from-dateTime($arg as xs:dateTime?) as xs:integer?
35 |
36 |
37 |

Properties

38 |
39 |

This function is deterministic, context-independent, and focus-independent. 40 |

41 |
42 |
43 |
44 |

Rules

45 |
46 |

If $arg is the empty sequence, the function returns the empty sequence. 47 |

48 |

Otherwise, the function returns an xs:integer between 1 and 31, both 49 | inclusive, representing the day component in the local value of $arg. 50 |

51 |
52 |
53 |
54 |

Examples

55 |
56 |

The expression fn:day-from-dateTime(xs:dateTime("1999-05-31T13:20:00-05:00")) returns 31. 57 |

58 |

The expression fn:day-from-dateTime(xs:dateTime("1999-12-31T20:00:00-05:00")) returns 31. 59 |

60 |

The expression fn:day-from-dateTime(fn:adjust-dateTime-to-timezone(xs:dateTime("1999-12-31T19:20:00-05:00"), 61 | xs:dayTimeDuration("PT0S"))) returns 1. 62 |

63 |
64 | 73 |
74 | 77 | 78 | -------------------------------------------------------------------------------- /fn/default-collation.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fn:default-collation 6 | 7 | 8 | 9 | 10 | 11 |
12 | 24 |
25 |
26 |
27 |

fn:default-collation

28 |
29 |

Returns the value of the default collation property from the static context.

30 |
31 |
32 |

Signature

33 |
fn:default-collation() as xs:string
34 |
35 |
36 |

Properties

37 |
38 |

This function is deterministic, context-dependent, and focus-independent. It depends on 39 | collations. 40 | 41 |

42 |
43 |
44 |
45 |

Rules

46 |
47 |

Returns the value of the default collation property from the static context. Components 48 | of the static context are described in Static Context 49 | Components. 50 |

51 |
52 |
53 |
54 |

Notes

55 |
56 |

The default collation property can never be absent. If it is not explicitly defined, 57 | a 58 | system defined default can be invoked. If this is not provided, the Unicode codepoint 59 | collation (http://www.w3.org/2005/xpath-functions/collation/codepoint) is 60 | used. 61 |

62 |
63 | 72 |
73 | 76 | 77 | -------------------------------------------------------------------------------- /fn/default-language.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fn:default-language 6 | 7 | 8 | 9 | 10 | 11 |
12 | 24 |
25 |
26 |
27 |

fn:default-language

28 |
29 |

Returns the value of the default language property from the dynamic context.

30 |
31 |
32 |

Signature

33 |
fn:default-language() as xs:language
34 |
35 |
36 |

Properties

37 |
38 |

This function is deterministic, context-dependent, and focus-independent. It depends on 39 | default language. 40 | 41 |

42 |
43 |
44 |
45 |

Rules

46 |
47 |

Returns the value of the default language property from the dynamic context. Components 48 | of the dynamic context are described in Dynamic Context. 49 |

50 |
51 |
52 |
53 |

Notes

54 |
55 |

The default language property can never be absent. The functions fn:format-integer, 56 | fn:format-date, fn:format-time, and fn:format-dateTime 57 | are defined to use the default language if no explicit language is supplied. The default 58 | language 59 | may play a role in selection of a default collation, but this is not a requirement. 60 |

61 |
62 | 69 |
70 | 73 | 74 | -------------------------------------------------------------------------------- /fn/doc-available.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fn:doc-available 6 | 7 | 8 | 9 | 10 | 11 |
12 | 24 |
25 |
26 |
27 |

fn:doc-available

28 |
29 |

The function returns true if and only if the function call fn:doc($uri) 30 | would return a document node. 31 |

32 |
33 |
34 |

Signature

35 |
fn:doc-available($uri as xs:string?) as xs:boolean
36 |
37 |
38 |

Properties

39 |
40 |

This function is deterministic, context-dependent, and focus-independent. It depends on 41 | available documents, and static base URI. 42 | 43 |

44 |
45 |
46 |
47 |

Rules

48 |
49 |

If $uri is an empty sequence, this function returns false. 50 |

51 |

If a call on fn:doc($uri) would return a document node, this function 52 | returns true. 53 |

54 |

In all other cases this function returns false. This 55 | includes the case where an invalid URI is supplied, and also the case where 56 | a valid relative URI reference is supplied, and cannot be resolved, 57 | for example because the static base URI is absent. 58 |

59 |

If this function returns true, then calling fn:doc($uri) 60 | within the same execution scope must return a document node. However, 61 | if nondeterministic processing has been selected for the fn:doc function, 62 | this guarantee is lost. 63 |

64 |
65 | 74 |
75 | 78 | 79 | -------------------------------------------------------------------------------- /fn/exactly-one.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fn:exactly-one 6 | 7 | 8 | 9 | 10 | 11 |
12 | 24 |
25 |
26 |
27 |

fn:exactly-one

28 |
29 |

Returns $arg if it contains exactly one item. Otherwise, raises an error. 30 | 31 |

32 |
33 |
34 |

Signature

35 |
fn:exactly-one($arg as item()*) as item()
36 |
37 |
38 |

Properties

39 |
40 |

This function is deterministic, context-independent, and focus-independent. 41 |

42 |
43 |
44 |
45 |

Rules

46 |
47 |

Except in error cases, the function returns $arg unchanged. 48 |

49 |
50 |
51 |
52 |

Error Conditions

53 |
54 |

A dynamic error is raised [ERRFORG0005] if $arg is an 55 | empty sequence or a sequence containing more than one item. 56 |

57 |
58 | 67 |
68 | 71 | 72 | -------------------------------------------------------------------------------- /fn/false.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fn:false 6 | 7 | 8 | 9 | 10 | 11 |
12 | 24 |
25 |
26 |
27 |

fn:false

28 |
29 |

Returns the xs:boolean value false. 30 |

31 |
32 |
33 |

Signature

34 |
fn:false() as xs:boolean
35 |
36 |
37 |

Properties

38 |
39 |

This function is deterministic, context-independent, and focus-independent. 40 |

41 |
42 |
43 |
44 |

Rules

45 |
46 |

The result is equivalent to xs:boolean("0"). 47 |

48 |
49 |
50 |
51 |

Examples

52 |
53 |

The expression fn:false() returns xs:boolean(0). 54 |

55 |
56 | 65 |
66 | 69 | 70 | -------------------------------------------------------------------------------- /fn/function-arity.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fn:function-arity 6 | 7 | 8 | 9 | 10 | 11 |
12 | 24 |
25 |
26 |
27 |

fn:function-arity

28 |
29 |

Returns the arity of the function identified by a function item.

30 |
31 |
32 |

Signature

33 |
fn:function-arity($func as function(*)) as xs:integer
34 |
35 |
36 |

Properties

37 |
38 |

This function is deterministic, context-independent, focus-independent, and higher-order. 39 |

40 |
41 |
42 |
43 |

Rules

44 |
45 |

The fn:function-arity function returns the arity (number of arguments) of 46 | the function identified by $func. 47 |

48 |
49 |
50 |
51 |

Examples

52 |
53 |

The expression fn:function-arity(fn:substring#2) returns 2. 54 |

55 |

The expression fn:function-arity(function($node){name($node)}) returns 1. 56 |

57 |

The expression let $initial := fn:substring(?, 1, 1) return 58 | fn:function-arity($initial) returns 1. 59 |

60 |
61 | 69 |
70 | 73 | 74 | -------------------------------------------------------------------------------- /fn/function-name.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fn:function-name 6 | 7 | 8 | 9 | 10 | 11 |
12 | 24 |
25 |
26 |
27 |

fn:function-name

28 |
29 |

Returns the name of the function identified by a function item.

30 |
31 |
32 |

Signature

33 |
fn:function-name($func as function(*)) as xs:QName?
34 |
35 |
36 |

Properties

37 |
38 |

This function is deterministic, context-independent, focus-independent, and higher-order. 39 |

40 |
41 |
42 |
43 |

Rules

44 |
45 |

If $func refers to a named function, fn:function-name($func) 46 | returns the name of that function. 47 |

48 |

Otherwise ($func refers to an anonymous function), 49 | fn:function-name($func) returns an empty sequence. 50 |

51 |

The prefix part of the returned QName is implementation-dependent. 52 |

53 |
54 |
55 |
56 |

Examples

57 |
58 |

The expression fn:function-name(fn:substring#2) returns fn:QName("http://www.w3.org/2005/xpath-functions", 59 | "fn:substring"). (The namespace prefix of the returned QName is not 60 | predictable.) 61 |

62 |

The expression fn:function-name(function($node){count($node/*)}) returns (). 63 |

64 |
65 | 73 |
74 | 77 | 78 | -------------------------------------------------------------------------------- /fn/head.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fn:head 6 | 7 | 8 | 9 | 10 | 11 |
12 | 24 |
25 |
26 |
27 |

fn:head

28 |
29 |

Returns the first item in a sequence.

30 |
31 |
32 |

Signature

33 |
fn:head($arg as item()*) as item()?
34 |
35 |
36 |

Properties

37 |
38 |

This function is deterministic, context-independent, and focus-independent. 39 |

40 |
41 |
42 |
43 |

Rules

44 |
45 |

The function returns the value of the expression $arg[1]

46 |
47 |
48 |
49 |

Notes

50 |
51 |

If $arg is the empty sequence, the empty sequence is returned. Otherwise 52 | the first item in the sequence is returned. 53 |

54 |
55 |
56 |
57 |

Examples

58 |
59 |

The expression fn:head(1 to 5) returns 1. 60 |

61 |

The expression fn:head(("a", "b", "c")) returns "a". 62 |

63 |

The expression fn:head(()) returns (). 64 |

65 |

The expression fn:head([1,2,3]) returns [1,2,3]. 66 |

67 |
68 | 76 |
77 | 80 | 81 | -------------------------------------------------------------------------------- /fn/implicit-timezone.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fn:implicit-timezone 6 | 7 | 8 | 9 | 10 | 11 |
12 | 24 |
25 |
26 |
27 |

fn:implicit-timezone

28 |
29 |

Returns the value of the implicit timezone property from the dynamic context.

30 |
31 |
32 |

Signature

33 |
fn:implicit-timezone() as xs:dayTimeDuration
34 |
35 |
36 |

Properties

37 |
38 |

This function is deterministic, context-dependent, and focus-independent. It depends on 39 | implicit timezone. 40 | 41 |

42 |
43 |
44 |
45 |

Rules

46 |
47 |

Returns the value of the implicit timezone property from the dynamic context. Components 48 | of the dynamic context are described in Dynamic Context Components. 49 |

50 |
51 | 60 |
61 | 64 | 65 | -------------------------------------------------------------------------------- /fn/in-scope-prefixes.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fn:in-scope-prefixes 6 | 7 | 8 | 9 | 10 | 11 |
12 | 24 |
25 |
26 |
27 |

fn:in-scope-prefixes

28 |
29 |

Returns the prefixes of the in-scope namespaces for an element node.

30 |
31 |
32 |

Signature

33 |
fn:in-scope-prefixes($element as element()) as xs:string*
34 |
35 |
36 |

Properties

37 |
38 |

This function is nondeterministic-wrt-ordering, context-independent, and focus-independent. 39 |

40 |
41 |
42 |
43 |

Rules

44 |
45 |

The function returns a sequence of strings representing the prefixes of the in-scope 46 | namespaces for $element. 47 |

48 |

For namespace bindings that have a prefix, the function returns the prefix as an 49 | xs:NCName. For the default namespace, which has no prefix, it returns 50 | the zero-length string. 51 |

52 |

The result sequence contains no duplicates.

53 |

The ordering of the result sequence is implementation-dependent. 54 |

55 |
56 |
57 |
58 |

Notes

59 |
60 |

The XML namespace is in scope for every element, so the result will always include 61 | the string "xml". 62 |

63 |
64 | 73 |
74 | 77 | 78 | -------------------------------------------------------------------------------- /fn/last.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fn:last 6 | 7 | 8 | 9 | 10 | 11 |
12 | 24 |
25 |
26 |
27 |

fn:last

28 |
29 |

Returns the context size from the dynamic context.

30 |
31 |
32 |

Signature

33 |
fn:last() as xs:integer
34 |
35 |
36 |

Properties

37 |
38 |

This function is deterministic, context-dependent, and focus-dependent. 39 |

40 |
41 |
42 |
43 |

Rules

44 |
45 |

Returns the context size from the dynamic context. (See Dynamic Context Components.) 46 |

47 |
48 |
49 |
50 |

Error Conditions

51 |
52 |

A dynamic error is raised [ERRXPDY0002] if 53 | the context size is absent. 54 |

55 |
56 |
57 |
58 |

Notes

59 |
60 |

Under most circumstances, the context size is absent only if the context item is absent. 61 | However, XSLT 3.0 with 62 | streaming defines situations in which the context item and context position are known, 63 | but the context size is unknown. 64 |

65 |
66 |
67 |
68 |

Examples

69 |
70 |

The expression (1 to 20)[fn:last() - 1] returns 19. 71 |

72 |
73 | 82 |
83 | 86 | 87 | -------------------------------------------------------------------------------- /fn/local-name-from-QName.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fn:local-name-from-QName 6 | 7 | 8 | 9 | 10 | 11 |
12 | 24 |
25 |
26 |
27 |

fn:local-name-from-QName

28 |
29 |

Returns the local part of the supplied QName.

30 |
31 |
32 |

Signature

33 |
fn:local-name-from-QName($arg as xs:QName?) as xs:NCName?
34 |
35 |
36 |

Properties

37 |
38 |

This function is deterministic, context-independent, and focus-independent. 39 |

40 |
41 |
42 |
43 |

Rules

44 |
45 |

If $arg is the empty sequence the function returns the empty sequence. 46 |

47 |

Otherwise, the function returns an xs:NCName representing the local part of 48 | $arg. 49 |

50 |
51 |
52 |
53 |

Examples

54 |
55 |

The expression fn:local-name-from-QName(fn:QName("http://www.example.com/example", 56 | "person")) returns "person". 57 |

58 |
59 | 68 |
69 | 72 | 73 | -------------------------------------------------------------------------------- /fn/minutes-from-dateTime.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fn:minutes-from-dateTime 6 | 7 | 8 | 9 | 10 | 11 |
12 | 24 |
25 |
26 |
27 |

fn:minutes-from-dateTime

28 |
29 |

Returns the minute component of an xs:dateTime. 30 |

31 |
32 |
33 |

Signature

34 |
fn:minutes-from-dateTime($arg as xs:dateTime?) as xs:integer?
35 |
36 |
37 |

Properties

38 |
39 |

This function is deterministic, context-independent, and focus-independent. 40 |

41 |
42 |
43 |
44 |

Rules

45 |
46 |

If $arg is the empty sequence, the function returns the empty sequence. 47 |

48 |

Otherwise, the function returns an xs:integer value between 0 and 59, both 49 | inclusive, representing the minute component in the local value of 50 | $arg. 51 |

52 |
53 |
54 |
55 |

Examples

56 |
57 |

The expression fn:minutes-from-dateTime(xs:dateTime("1999-05-31T13:20:00-05:00")) returns 20. 58 |

59 |

The expression fn:minutes-from-dateTime(xs:dateTime("1999-05-31T13:30:00+05:30")) returns 30. 60 |

61 |
62 | 71 |
72 | 75 | 76 | -------------------------------------------------------------------------------- /fn/minutes-from-duration.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fn:minutes-from-duration 6 | 7 | 8 | 9 | 10 | 11 |
12 | 24 |
25 |
26 |
27 |

fn:minutes-from-duration

28 |
29 |

Returns the number of minutes in a duration.

30 |
31 |
32 |

Signature

33 |
fn:minutes-from-duration($arg as xs:duration?) as xs:integer?
34 |
35 |
36 |

Properties

37 |
38 |

This function is deterministic, context-independent, and focus-independent. 39 |

40 |
41 |
42 |
43 |

Rules

44 |
45 |

If $arg is the empty sequence, the function returns the empty sequence. 46 |

47 |

Otherwise, the function returns an xs:integer representing the minutes 48 | component in the value of $arg. Given that a duration 49 | is a ($months, $seconds) tuple, the result is the value of ($seconds mod 3600) idiv 60. 50 |

51 |

If $arg is a negative duration then the result will be negative. 52 |

53 |

If $arg is an xs:yearMonthDuration the function returns 0. 54 |

55 |
56 |
57 |
58 |

Examples

59 |
60 |

The expression fn:minutes-from-duration(xs:dayTimeDuration("P3DT10H")) returns 0. 61 |

62 |

The expression fn:minutes-from-duration(xs:dayTimeDuration("-P5DT12H30M")) returns -30. 63 |

64 |
65 | 74 |
75 | 78 | 79 | -------------------------------------------------------------------------------- /fn/minutes-from-time.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fn:minutes-from-time 6 | 7 | 8 | 9 | 10 | 11 |
12 | 24 |
25 |
26 |
27 |

fn:minutes-from-time

28 |
29 |

Returns the minutes component of an xs:time. 30 |

31 |
32 |
33 |

Signature

34 |
fn:minutes-from-time($arg as xs:time?) as xs:integer?
35 |
36 |
37 |

Properties

38 |
39 |

This function is deterministic, context-independent, and focus-independent. 40 |

41 |
42 |
43 |
44 |

Rules

45 |
46 |

If $arg is the empty sequence, the function returns the empty sequence. 47 |

48 |

Otherwise, the function returns an xs:integer value between 0 and 59, both 49 | inclusive, representing the value of the minutes component in the local value of 50 | $arg. 51 |

52 |
53 |
54 |
55 |

Examples

56 |
57 |

The expression fn:minutes-from-time(xs:time("13:00:00Z")) returns 0. 58 |

59 |
60 | 69 |
70 | 73 | 74 | -------------------------------------------------------------------------------- /fn/month-from-date.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fn:month-from-date 6 | 7 | 8 | 9 | 10 | 11 |
12 | 24 |
25 |
26 |
27 |

fn:month-from-date

28 |
29 |

Returns the month component of an xs:date. 30 |

31 |
32 |
33 |

Signature

34 |
fn:month-from-date($arg as xs:date?) as xs:integer?
35 |
36 |
37 |

Properties

38 |
39 |

This function is deterministic, context-independent, and focus-independent. 40 |

41 |
42 |
43 |
44 |

Rules

45 |
46 |

If $arg is the empty sequence, the function returns the empty sequence. 47 |

48 |

Otherwise, the function returns an xs:integer between 1 and 12, both 49 | inclusive, representing the month component in the local value of $arg. 50 | 51 |

52 |
53 |
54 |
55 |

Examples

56 |
57 |

The expression fn:month-from-date(xs:date("1999-05-31-05:00")) returns 5. 58 |

59 |

The expression fn:month-from-date(xs:date("2000-01-01+05:00")) returns 1. 60 |

61 |
62 | 71 |
72 | 75 | 76 | -------------------------------------------------------------------------------- /fn/month-from-dateTime.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fn:month-from-dateTime 6 | 7 | 8 | 9 | 10 | 11 |
12 | 24 |
25 |
26 |
27 |

fn:month-from-dateTime

28 |
29 |

Returns the month component of an xs:dateTime. 30 |

31 |
32 |
33 |

Signature

34 |
fn:month-from-dateTime($arg as xs:dateTime?) as xs:integer?
35 |
36 |
37 |

Properties

38 |
39 |

This function is deterministic, context-independent, and focus-independent. 40 |

41 |
42 |
43 |
44 |

Rules

45 |
46 |

If $arg is the empty sequence, the function returns the empty sequence. 47 |

48 |

Otherwise, the function returns an xs:integer between 1 and 12, both 49 | inclusive, representing the month component in the local value of $arg. 50 |

51 |
52 |
53 |
54 |

Examples

55 |
56 |

The expression fn:month-from-dateTime(xs:dateTime("1999-05-31T13:20:00-05:00")) returns 5. 57 |

58 |

The expression fn:month-from-dateTime(xs:dateTime("1999-12-31T19:20:00-05:00")) returns 12. 59 |

60 |

The expression fn:month-from-dateTime(fn:adjust-dateTime-to-timezone(xs:dateTime("1999-12-31T19:20:00-05:00"), 61 | xs:dayTimeDuration("PT0S"))) returns 1. 62 |

63 |
64 | 73 |
74 | 77 | 78 | -------------------------------------------------------------------------------- /fn/namespace-uri-from-QName.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fn:namespace-uri-from-QName 6 | 7 | 8 | 9 | 10 | 11 |
12 | 24 |
25 |
26 |
27 |

fn:namespace-uri-from-QName

28 |
29 |

Returns the namespace URI part of the supplied QName.

30 |
31 |
32 |

Signature

33 |
fn:namespace-uri-from-QName($arg as xs:QName?) as xs:anyURI?
34 |
35 |
36 |

Properties

37 |
38 |

This function is deterministic, context-independent, and focus-independent. 39 |

40 |
41 |
42 |
43 |

Rules

44 |
45 |

If $arg is the empty sequence the function returns the empty sequence. 46 |

47 |

Otherwise, the function returns an xs:anyURI representing the namespace URI 48 | part of $arg. 49 |

50 |

If $arg is in no namespace, the function returns the zero-length 51 | xs:anyURI. 52 |

53 |
54 |
55 |
56 |

Examples

57 |
58 |

The expression fn:namespace-uri-from-QName(fn:QName("http://www.example.com/example", 59 | "person")) returns xs:anyURI("http://www.example.com/example"). 60 |

61 |
62 | 71 |
72 | 75 | 76 | -------------------------------------------------------------------------------- /fn/not.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fn:not 6 | 7 | 8 | 9 | 10 | 11 |
12 | 24 |
25 |
26 |
27 |

fn:not

28 |
29 |

Returns true if the effective boolean value of $arg is 30 | false, or false if it is true. 31 |

32 |
33 |
34 |

Signature

35 |
fn:not($arg as item()*) as xs:boolean
36 |
37 |
38 |

Properties

39 |
40 |

This function is deterministic, context-independent, and focus-independent. 41 |

42 |
43 |
44 |
45 |

Rules

46 |
47 |

The value of $arg is first reduced to an effective boolean value by 48 | applying the fn:boolean() function. The function returns true 49 | if the effective boolean value is false, or false if the 50 | effective boolean value is true. 51 |

52 |
53 |
54 |
55 |

Examples

56 |
57 |

The expression fn:not(fn:true()) returns false(). 58 |

59 |

The expression fn:not(()) returns true(). 60 |

61 |

The expression fn:not("false") returns false(). 62 |

63 |

fn:not(1 to 10) raises a type error [ERRFORG0006]. 64 |

65 |
66 | 75 |
76 | 79 | 80 | -------------------------------------------------------------------------------- /fn/one-or-more.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fn:one-or-more 6 | 7 | 8 | 9 | 10 | 11 |
12 | 24 |
25 |
26 |
27 |

fn:one-or-more

28 |
29 |

Returns $arg if it contains one or more items. Otherwise, raises an error. 30 | 31 |

32 |
33 |
34 |

Signature

35 |
fn:one-or-more($arg as item()*) as item()+
36 |
37 |
38 |

Properties

39 |
40 |

This function is deterministic, context-independent, and focus-independent. 41 |

42 |
43 |
44 |
45 |

Rules

46 |
47 |

Except in error cases, the function returns $arg unchanged. 48 |

49 |
50 |
51 |
52 |

Error Conditions

53 |
54 |

A dynamic error is raised [ERRFORG0004] if $arg is an 55 | empty sequence. 56 |

57 |
58 | 67 |
68 | 71 | 72 | -------------------------------------------------------------------------------- /fn/position.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fn:position 6 | 7 | 8 | 9 | 10 | 11 |
12 | 24 |
25 |
26 |
27 |

fn:position

28 |
29 |

Returns the context position from the dynamic context.

30 |
31 |
32 |

Signature

33 |
fn:position() as xs:integer
34 |
35 |
36 |

Properties

37 |
38 |

This function is deterministic, context-dependent, and focus-dependent. 39 |

40 |
41 |
42 |
43 |

Rules

44 |
45 |

Returns the context position from the dynamic context. (See Dynamic Context Components.) 46 |

47 |
48 |
49 |
50 |

Error Conditions

51 |
52 |

A dynamic error is raised [ERRXPDY0002] if 53 | the context item is absent. 54 |

55 |
56 | 65 |
66 | 69 | 70 | -------------------------------------------------------------------------------- /fn/prefix-from-QName.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fn:prefix-from-QName 6 | 7 | 8 | 9 | 10 | 11 |
12 | 24 |
25 |
26 |
27 |

fn:prefix-from-QName

28 |
29 |

Returns the prefix component of the supplied QName.

30 |
31 |
32 |

Signature

33 |
fn:prefix-from-QName($arg as xs:QName?) as xs:NCName?
34 |
35 |
36 |

Properties

37 |
38 |

This function is deterministic, context-independent, and focus-independent. 39 |

40 |
41 |
42 |
43 |

Rules

44 |
45 |

If $arg is the empty sequence the function returns the empty sequence. 46 |

47 |

If $arg has no prefix component the function returns the empty 48 | sequence. 49 |

50 |

Otherwise, the function returns an xs:NCName representing the prefix 51 | component of $arg. 52 |

53 |
54 | 63 |
64 | 67 | 68 | -------------------------------------------------------------------------------- /fn/seconds-from-dateTime.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fn:seconds-from-dateTime 6 | 7 | 8 | 9 | 10 | 11 |
12 | 24 |
25 |
26 |
27 |

fn:seconds-from-dateTime

28 |
29 |

Returns the seconds component of an xs:dateTime. 30 |

31 |
32 |
33 |

Signature

34 |
fn:seconds-from-dateTime($arg as xs:dateTime?) as xs:decimal?
35 |
36 |
37 |

Properties

38 |
39 |

This function is deterministic, context-independent, and focus-independent. 40 |

41 |
42 |
43 |
44 |

Rules

45 |
46 |

If $arg is the empty sequence, the function returns the empty sequence. 47 |

48 |

Otherwise, the function returns an xs:decimal value greater than or equal 49 | to zero and less than 60, representing the seconds and fractional seconds in the local 50 | value of $arg. 51 |

52 |
53 |
54 |
55 |

Examples

56 |
57 |

The expression fn:seconds-from-dateTime(xs:dateTime("1999-05-31T13:20:00-05:00")) returns 0. 58 |

59 |
60 | 69 |
70 | 73 | 74 | -------------------------------------------------------------------------------- /fn/seconds-from-duration.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fn:seconds-from-duration 6 | 7 | 8 | 9 | 10 | 11 |
12 | 24 |
25 |
26 |
27 |

fn:seconds-from-duration

28 |
29 |

Returns the number of seconds in a duration.

30 |
31 |
32 |

Signature

33 |
fn:seconds-from-duration($arg as xs:duration?) as xs:decimal?
34 |
35 |
36 |

Properties

37 |
38 |

This function is deterministic, context-independent, and focus-independent. 39 |

40 |
41 |
42 |
43 |

Rules

44 |
45 |

If $arg is the empty sequence, the function returns the empty sequence. 46 |

47 |

Otherwise, the function returns an xs:decimal representing the seconds 48 | component in the value of $arg. Given that a duration 49 | is a ($months, $seconds) tuple, the result is the value of ($seconds mod 60) 50 | as an xs:decimal. 51 |

52 |

If $arg is a negative duration then the result will be negative. 53 |

54 |

If $arg is an xs:yearMonthDuration the function returns 0. 55 |

56 |
57 |
58 |
59 |

Examples

60 |
61 |

The expression fn:seconds-from-duration(xs:dayTimeDuration("P3DT10H12.5S")) returns 12.5. 62 |

63 |

The expression fn:seconds-from-duration(xs:dayTimeDuration("-PT256S")) returns -16.0. 64 |

65 |
66 | 75 |
76 | 79 | 80 | -------------------------------------------------------------------------------- /fn/seconds-from-time.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fn:seconds-from-time 6 | 7 | 8 | 9 | 10 | 11 |
12 | 24 |
25 |
26 |
27 |

fn:seconds-from-time

28 |
29 |

Returns the seconds component of an xs:time. 30 |

31 |
32 |
33 |

Signature

34 |
fn:seconds-from-time($arg as xs:time?) as xs:decimal?
35 |
36 |
37 |

Properties

38 |
39 |

This function is deterministic, context-independent, and focus-independent. 40 |

41 |
42 |
43 |
44 |

Rules

45 |
46 |

If $arg is the empty sequence, the function returns the empty sequence. 47 |

48 |

Otherwise, the function returns an xs:decimal value greater than or equal 49 | to zero and less than 60, representing the seconds and fractional seconds in the local 50 | value of $arg. 51 |

52 |
53 |
54 |
55 |

Examples

56 |
57 |

The expression fn:seconds-from-time(xs:time("13:20:10.5")) returns 10.5. 58 |

59 |
60 | 69 |
70 | 73 | 74 | -------------------------------------------------------------------------------- /fn/static-base-uri.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fn:static-base-uri 6 | 7 | 8 | 9 | 10 | 11 |
12 | 24 |
25 |
26 |
27 |

fn:static-base-uri

28 |
29 |

This function returns the value of the static base URI property from the static 30 | context. 31 |

32 |
33 |
34 |

Signature

35 |
fn:static-base-uri() as xs:anyURI?
36 |
37 |
38 |

Properties

39 |
40 |

This function is deterministic, context-dependent, and focus-independent. It depends on 41 | static base URI. 42 | 43 |

44 |
45 |
46 |
47 |

Rules

48 |
49 |

The function returns the value of the static base URI property from the static context. 50 | If the property is absent, the empty sequence is returned. 51 |

52 |

Components of the static context are described in Static Context . 53 |

54 |
55 |
56 |
57 |

Notes

58 |
59 |

XQuery 3.0 and XSLT 3.0 give an implementation freedom to use different base URIs 60 | during 61 | the static analysis phase and the dynamic evaluation phase, that is, for compile-time 62 | and run-time resources respectively. This is appropriate when the implementation allows 63 | the output of static analysis (a "compiled" query or stylesheet) to be deployed for 64 | execution 65 | to a different location from the one where static analysis took place. In this situation, 66 | the 67 | fn:static-base-uri function should return a URI suitable for locating 68 | resources needed during dynamic evaluation. 69 |

70 |
71 | 80 |
81 | 84 | 85 | -------------------------------------------------------------------------------- /fn/string-to-codepoints.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fn:string-to-codepoints 6 | 7 | 8 | 9 | 10 | 11 |
12 | 24 |
25 |
26 |
27 |

fn:string-to-codepoints

28 |
29 |

Returns the sequence of codepoints that constitute an 30 | xs:string value. 31 |

32 |
33 |
34 |

Signature

35 |
fn:string-to-codepoints($arg as xs:string?) as xs:integer*
36 |
37 |
38 |

Properties

39 |
40 |

This function is deterministic, context-independent, and focus-independent. 41 |

42 |
43 |
44 |
45 |

Rules

46 |
47 |

The function returns a sequence of integers, each integer being the Unicode codepoint of the corresponding character in $arg. 48 |

49 |

If $arg is a zero-length string or the empty sequence, the function returns 50 | the empty sequence. 51 |

52 |
53 |
54 |
55 |

Examples

56 |
57 |

The expression fn:string-to-codepoints("Thérèse") returns (84, 104, 233, 114, 232, 115, 101). 58 |

59 |
60 | 69 |
70 | 73 | 74 | -------------------------------------------------------------------------------- /fn/tail.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fn:tail 6 | 7 | 8 | 9 | 10 | 11 |
12 | 24 |
25 |
26 |
27 |

fn:tail

28 |
29 |

Returns all but the first item in a sequence.

30 |
31 |
32 |

Signature

33 |
fn:tail($arg as item()*) as item()*
34 |
35 |
36 |

Properties

37 |
38 |

This function is deterministic, context-independent, and focus-independent. 39 |

40 |
41 |
42 |
43 |

Rules

44 |
45 |

The function returns the value of the expression subsequence($arg, 2)

46 |
47 |
48 |
49 |

Notes

50 |
51 |

If $arg is the empty sequence, or a sequence containing a single item, then 52 | the empty sequence is returned. 53 |

54 |
55 |
56 |
57 |

Examples

58 |
59 |

The expression fn:tail(1 to 5) returns (2, 3, 4, 5). 60 |

61 |

The expression fn:tail(("a", "b", "c")) returns ("b", "c"). 62 |

63 |

The expression fn:tail("a") returns (). 64 |

65 |

The expression fn:tail(()) returns (). 66 |

67 |

The expression fn:tail([1,2,3]) returns (). 68 |

69 |
70 | 78 |
79 | 82 | 83 | -------------------------------------------------------------------------------- /fn/timezone-from-date.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fn:timezone-from-date 6 | 7 | 8 | 9 | 10 | 11 |
12 | 24 |
25 |
26 |
27 |

fn:timezone-from-date

28 |
29 |

Returns the timezone component of an xs:date. 30 |

31 |
32 |
33 |

Signature

34 |
fn:timezone-from-date($arg as xs:date?) as xs:dayTimeDuration?
35 |
36 |
37 |

Properties

38 |
39 |

This function is deterministic, context-independent, and focus-independent. 40 |

41 |
42 |
43 |
44 |

Rules

45 |
46 |

If $arg is the empty sequence, the function returns the empty sequence. 47 |

48 |

Otherwise, the function returns the timezone component of $arg, if any. If 49 | $arg has a timezone component, then the result is an 50 | xs:dayTimeDuration that indicates deviation from UTC; its value may 51 | range from +14:00 to -14:00 hours, both inclusive. If $arg has no timezone 52 | component, the result is the empty sequence. 53 |

54 |
55 |
56 |
57 |

Examples

58 |
59 |

The expression fn:timezone-from-date(xs:date("1999-05-31-05:00")) returns xs:dayTimeDuration("-PT5H"). 60 |

61 |

The expression fn:timezone-from-date(xs:date("2000-06-12Z")) returns xs:dayTimeDuration("PT0S"). 62 |

63 |
64 | 73 |
74 | 77 | 78 | -------------------------------------------------------------------------------- /fn/timezone-from-time.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fn:timezone-from-time 6 | 7 | 8 | 9 | 10 | 11 |
12 | 24 |
25 |
26 |
27 |

fn:timezone-from-time

28 |
29 |

Returns the timezone component of an xs:time. 30 |

31 |
32 |
33 |

Signature

34 |
fn:timezone-from-time($arg as xs:time?) as xs:dayTimeDuration?
35 |
36 |
37 |

Properties

38 |
39 |

This function is deterministic, context-independent, and focus-independent. 40 |

41 |
42 |
43 |
44 |

Rules

45 |
46 |

If $arg is the empty sequence, the function returns the empty sequence. 47 |

48 |

Otherwise, the function returns the timezone component of $arg, if any. If 49 | $arg has a timezone component, then the result is an 50 | xs:dayTimeDuration that indicates deviation from UTC; its value may 51 | range from +14:00 to -14:00 hours, both inclusive. If $arg has no timezone 52 | component, the result is the empty sequence. 53 |

54 |
55 |
56 |
57 |

Examples

58 |
59 |

The expression fn:timezone-from-time(xs:time("13:20:00-05:00")) returns xs:dayTimeDuration("-PT5H"). 60 |

61 |

The expression fn:timezone-from-time(xs:time("13:20:00")) returns (). 62 |

63 |
64 | 73 |
74 | 77 | 78 | -------------------------------------------------------------------------------- /fn/true.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fn:true 6 | 7 | 8 | 9 | 10 | 11 |
12 | 24 |
25 |
26 |
27 |

fn:true

28 |
29 |

Returns the xs:boolean value true. 30 |

31 |
32 |
33 |

Signature

34 |
fn:true() as xs:boolean
35 |
36 |
37 |

Properties

38 |
39 |

This function is deterministic, context-independent, and focus-independent. 40 |

41 |
42 |
43 |
44 |

Rules

45 |
46 |

The result is equivalent to xs:boolean("1"). 47 |

48 |
49 |
50 |
51 |

Examples

52 |
53 |

The expression fn:true() returns xs:boolean(1). 54 |

55 |
56 | 65 |
66 | 69 | 70 | -------------------------------------------------------------------------------- /fn/zero-or-one.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | fn:zero-or-one 6 | 7 | 8 | 9 | 10 | 11 |
12 | 24 |
25 |
26 |
27 |

fn:zero-or-one

28 |
29 |

Returns $arg if it contains zero or one items. Otherwise, raises an 30 | error. 31 |

32 |
33 |
34 |

Signature

35 |
fn:zero-or-one($arg as item()*) as item()?
36 |
37 |
38 |

Properties

39 |
40 |

This function is deterministic, context-independent, and focus-independent. 41 |

42 |
43 |
44 |
45 |

Rules

46 |
47 |

Except in error cases, the function returns $arg unchanged. 48 |

49 |
50 |
51 |
52 |

Error Conditions

53 |
54 |

A dynamic error is raised [ERRFORG0003] if $arg 55 | contains more than one item. 56 |

57 |
58 | 67 |
68 | 71 | 72 | -------------------------------------------------------------------------------- /map/size.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | map:size 6 | 7 | 8 | 9 | 10 | 11 |
12 | 24 |
25 |
26 |
27 |

map:size

28 |
29 |

Returns the number of entries in the supplied map.

30 |
31 |
32 |

Signature

33 |
map:size($map as map(*)) as xs:integer
34 |
35 |
36 |

Properties

37 |
38 |

This function is deterministic, context-independent, and focus-independent. 39 |

40 |
41 |
42 |
43 |

Rules

44 |
45 |

The function map:size takes any map 46 | as its $map argument and returns the number of entries that are present 47 | in the map. 48 |

49 |
50 |
51 |
52 |

Examples

53 |
54 |

The expression map:size(map{}) returns 0. 55 |

56 |

The expression map:size(map{"true":1, "false":0}) returns 2. 57 |

58 |
59 | 66 |
67 | 70 | 71 | -------------------------------------------------------------------------------- /math/pi.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | math:pi 6 | 7 | 8 | 9 | 10 | 11 |
12 | 24 |
25 |
26 |
27 |

math:pi

28 |
29 |

Returns an approximation to the mathematical constant π. 30 |

31 |
32 |
33 |

Signature

34 |
math:pi() as xs:double
35 |
36 |
37 |

Properties

38 |
39 |

This function is deterministic, context-independent, and focus-independent. 40 |

41 |
42 |
43 |
44 |

Rules

45 |
46 |

This function returns the xs:double value whose lexical representation is 47 | 3.141592653589793e0 48 |

49 |
50 |
51 |
52 |

Examples

53 |
54 |

The expression 2*math:pi() returns 6.283185307179586e0. 55 |

56 |

The expression 60 * (math:pi() div 180) converts an angle of 60 degrees 57 | to radians. 58 |

59 |
60 | 68 |
69 | 72 | 73 | -------------------------------------------------------------------------------- /packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /xpath-ref.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Express 2013 for Web 4 | VisualStudioVersion = 12.0.30723.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "xpath-ref", "http://localhost:50308", "{6BB627C1-59FF-456A-A6C4-72A082B0911F}" 7 | ProjectSection(WebsiteProperties) = preProject 8 | UseIISExpress = "true" 9 | TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.0" 10 | Debug.AspNetCompiler.VirtualPath = "/localhost_50308" 11 | Debug.AspNetCompiler.PhysicalPath = "." 12 | Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_50308\" 13 | Debug.AspNetCompiler.Updateable = "true" 14 | Debug.AspNetCompiler.ForceOverwrite = "true" 15 | Debug.AspNetCompiler.FixedNames = "false" 16 | Debug.AspNetCompiler.Debug = "True" 17 | Release.AspNetCompiler.VirtualPath = "/localhost_50308" 18 | Release.AspNetCompiler.PhysicalPath = "." 19 | Release.AspNetCompiler.TargetPath = "PrecompiledWeb\localhost_50308\" 20 | Release.AspNetCompiler.Updateable = "true" 21 | Release.AspNetCompiler.ForceOverwrite = "true" 22 | Release.AspNetCompiler.FixedNames = "false" 23 | Release.AspNetCompiler.Debug = "False" 24 | SlnRelativePath = "." 25 | EndProjectSection 26 | EndProject 27 | Global 28 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 29 | Debug|Any CPU = Debug|Any CPU 30 | EndGlobalSection 31 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 32 | {6BB627C1-59FF-456A-A6C4-72A082B0911F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 33 | {6BB627C1-59FF-456A-A6C4-72A082B0911F}.Debug|Any CPU.Build.0 = Debug|Any CPU 34 | EndGlobalSection 35 | GlobalSection(SolutionProperties) = preSolution 36 | HideSolutionNode = FALSE 37 | EndGlobalSection 38 | EndGlobal 39 | --------------------------------------------------------------------------------