Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. XML
  3. XPath
  4. Reference
  5. Functions

XPath functions

The following is an annotated list of coreXPath functions andXSLT-specific additions to XPath, including a description, syntax, a list of arguments, result-type, source in the appropriate W3C Recommendation. For further information on using XPath/XSLT functions, please see theFor Further Reading page.

boolean

Theboolean function evaluates an expression and returns true or false.

ceiling

Theceiling function evaluates a decimal number and returns the smallest integer greater than or equal to the decimal number.

choose

Thechoose function returns one of the specified objects based on a boolean parameter.

concat

Theconcat function concatenates two or more strings and returns the resulting string.

contains

Thecontains function determines whether the first argument string contains the second argument string and returns boolean true or false.

count

Thecount function counts the number of nodes in a node-set and returns an integer.

current

Thecurrent function can be used to get the context node in an XSLT instruction.

document

Thedocument finds a node-set in an external document, or multiple external documents, and returns the resulting node-set.

element-available

Theelement-available function determines if an element is available and returns true or false.

false

Thefalse function returns boolean false.

floor

Thefloor function evaluates a decimal number and returns the largest integer less than or equal to the decimal number.

format-number

Theformat-number function evaluates a number and returns a string representing the number in a given format.

function-available

Thefunction-available function determines if a given function is available and returns boolean true or false.

generate-id

Thegenerate-id function generates a unique id for the first node in a given node-set and returns a string containing that id.

id

Theid function finds nodes matching the given ids and returns a node-set containing the identified nodes.

key

Thekey function returns a node-set of nodes that have the given value for the given key.

lang

Thelang function determines whether the context node matches the given language and returns boolean true or false.

last

Thelast function returns a number equal to the context size from the expression evaluation context.

local-name

Thelocal-name function returns a string representing the local name of the first node in a given node-set.

name

Thename function returns a string representing the QName of the first node in a given node-set.

namespace-uri

Thenamespace-uri function returns a string representing the namespace URI of the first node in a given node-set.

normalize-space

Thenormalize-space function strips leading and trailing white-space from a string, replaces sequences of whitespace characters by a single space, and returns the resulting string.

not

Thenot function evaluates a boolean expression and returns the opposite value.

number

Thenumber function converts an object to a number and returns the number.

position

Theposition function returns a number equal to the context position from the expression evaluation context.

round

Theround function returns a number that is the nearest integer to the given number.

starts-with

Thestarts-with checks whether the first string starts with the second string and returns true or false.

string

Thestring function converts the given argument to a string.

string-length

Thestring-length function returns a number equal to the number of characters in a given string.

substring

Thesubstring function returns a part of a given string.

substring-after

Thesubstring-after function returns a string that is the rest of a given string after a given substring.

substring-before

Thesubstring-before function returns a string that is the part of a given string before a given substring.

sum

Thesum function returns a number that is the sum of the numeric values of each node in a given node-set.

system-property

Thesystem-property function returns an object representing the given system-property.

translate

Thetranslate function evaluates a string and a set of characters to translate and returns the translated string.

true

Thetrue function returns a boolean value of true.

unparsed-entity-url

Theunparsed-entity-url() function returns the URI of the unparsed entity with the given name. This is non-XML data referenced in the DTD of the source document.

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp