167 lines
16 KiB
Plaintext
167 lines
16 KiB
Plaintext
!function;param?desc?param?desc...;expression?result?expression?result
|
|
fn:last();current context node?Returns context size in expression context;
|
|
fn:position();current context node?Returns possition of current context node in expression context;
|
|
fn:count(node-set);node-set?Node-set to count nodes in;count(//b:book)?5?count(//person[@id>5])?17
|
|
fn:id(object);if nodeset?string value of each node in the node-set is treated as an id?if string?treated as a space-separated list of ids;
|
|
fn:local-name(node-set);node-set?Extract first node and return its local name;local-name(//b:books)?b:book?local-name(//b:book)?b:title
|
|
fn:local-name();current context node?Extract first node and return its local name;
|
|
fn:namespace-uri(node-set);node-set?Extract first node and return the namespace URI;namespace-uri(//b:book)?http://www.book.com?
|
|
fn:namespace-uri();current context node?Extract first node and return the namespace URI;
|
|
fn:name(node-set);node-set?Extract first node and return QName;name(//b:books/*)?b:book?name(//b:book/*)?b:title
|
|
fn:name();;current context node?Extract first node and return QName;
|
|
|
|
fn:string(object);string?The object to convert to a string;string((1<0))?false?string(.11)?0.11
|
|
fn:string();current context node?Converts current context node to string
|
|
fn:concat(string, string, string*);string?String to be merged?string?String to be merged?string*?any number of strings;concat("aa","bb")?aabb?concat("aa", 123)?aa123
|
|
fn:starts-with(string, string);string?String to be searched?string?String to be found;starts-with("aabb", "aa")?true?starts-with("aabb", "cc")?false
|
|
fn:contains(string, string);string?String to be searched?string?String to be found;contains("abc", "c")?true?contains("abc", "1")?false
|
|
fn:substring-before(string, string);string?String to be searched?string?String to be used to split;substring-before("aabbcc","bb")?aa?substring-before("aabbcc","c")?aabb
|
|
fn:substring-after(string, string);string?String to be searched?string?String to be used to split;substring-after("aabbcc","bb")?cc?substring-after("aabbcc","a")?abbcc
|
|
fn:substring(string, number, number);string?String to be cut?integer?Starting position?integer?Length of the substring;substring("aabbcc", 1, 2)?aa
|
|
fn:substring(string, number);string?String to be cut?integer?Starting position?;substring("aabbcc", 3)?bbcc
|
|
fn:string-length(string);string?String of which length should be returned;string-length("aabbcc")?6?string-length("aa bb cc")?8
|
|
fn:string-length();current context node?Converts current node to string and returns length;
|
|
fn:normalize-space(string);string?String to be normalized;normalize-space("aa bb cc")?aa bb cc?normalize-space("aa bb cc")?aa bb cc
|
|
fn:normalize-space();current context node?Converts current node to string and performs normalization;
|
|
fn:translate(string, string, string);string?String to be edited?string?sequence of characters to be replaced?string?sequence of character to be used in replacement;translate("aabbcc", "ab","xz")?xxzzcc?translate("Test sequence", "e","z")?Tzst szquzncz
|
|
|
|
fn:boolean(object);expression?The expression to be evaluated;boolean(1>2)?false?boolean("a"="a")?true
|
|
fn:not(boolean);boolean?Boolean value to be inverted;not("a"="a")?false?not(true)?false
|
|
fn:true();?Returns boolean value true;true()?true
|
|
fn:false();?Returns boolean value false;false()?false
|
|
fn:lang(string);string?Checks if the context node matches given language;(context: <data xml:lang="en"/>): lang('en')?true?(context: <data xml:lang="en-US"/>): lang('en')?true?(context: <data xml:lang="de"/>): lang('en')?false
|
|
|
|
fn:number(object);object?Converts given object to a number;number(true())?1?number(false())?0?number("55")?55?number(" 55 ")?55
|
|
fn:number();current context node?Converts current context node to a number;number(true())?1?number(false())?0?number("55")?55?number(" 55 ")?55
|
|
fn:sum(node-set);node-set?Summs each node from the set passed through number() function;
|
|
fn:floor(number);number?Decimal number to be converted to integer;floor(3.1)?3?floor(3.99)?3
|
|
fn:ceiling(number);number?Decimal number to be converted to integer;ceiling(3.1)?4?ceiling(3.99)?4
|
|
fn:round(number);number?Decimal number to be converted to integer;round(3.1)?3?round(3.6)?4
|
|
|
|
fn:timezone-from-dateTime(datetime);datetime?DateTime to extract fimezone information from;timezone-from-dateTime(xs:dateTime("2021-01-15T12:10:00-03:00"))?-PT3H
|
|
fn:year-from-dateTime(datetime);datetime?datetime to extract years component from;year-from-dateTime(xs:dateTime("2011-11-15T12:30-04:10"))?2011
|
|
fn:month-from-dateTime(datetime);datetime?datetime to extract month component from;month-from-dateTime(xs:dateTime("2011-11-15T12:30-04:10"))?11
|
|
fn:day-from-dateTime(datetime);datetime?datetime to extract day component from;day-from-dateTime(xs:dateTime("2011-11-15T12:30-04:10"))?15
|
|
fn:hours-from-dateTime(datetime);datetime?datetime to extract hours component from;hours-from-dateTime(xs:dateTime("2011-11-15T12:30-04:10"))?12
|
|
fn:minutes-from-dateTime(datetime);datetime?datetime to extract minutes component from;minutes-from-dateTime(xs:dateTime("2011-11-15T12:30-04:10"))?30
|
|
fn:seconds-from-dateTime(datetime);datetime?datetime to extract seconds component from;seconds-from-dateTime(xs:dateTime("2011-11-15T12:30:00-04:10"))?0
|
|
fn:hours-from-time(time);time?time to extact hours component from;hours-from-time(xs:time("10:22:00"))?10
|
|
fn:minutes-from-time(time);time?time to extract minutes component from;minutes-from-time(xs:time("10:22:00"))?22
|
|
fn:seconds-from-time(time);time?Time to convert to seconds;seconds-from-time(xs:time("10:22:00"))?0
|
|
fn:year-from-date(date);date?date to extract years component from;year-from-date(xs:date("2011-11-15"))?2011
|
|
fn:month-from-date(date);date?Date to extrat the month from;month-from-date(xs:date("2011-11-15"))?11
|
|
fn:day-from-date(date);date?date to extact day component from;day-from-date(xs:date("2011-04-23"))?23
|
|
fn:current-time();;current-time()?11:48:04.393361+01:00
|
|
fn:current-date();current-date()?2021-03-25+01:00
|
|
fn:current-dateTime();;current-dateTime()?2021-03-24T18:15:09.808+01:00
|
|
fn:dateTime(date,time);date?date to be merged into dateTime?time?time to be merged into dateTime;dateTime(xs:date("2011-11-15"), xs:time("10:22:00"))?2011-11-15T10:22:00
|
|
fn:timezone-from-time(time);time?time to extract timezone infromation from;timezone-from-time(xs:time("10:22:00+10:00"))?PT10H
|
|
fn:implicit-timezone();;implicit-timezone()?PT1H
|
|
fn:years-from-duration(datetimedur);datetimedur?datetimedur to extract years component from;years-from-duration(xs:duration("P5Y2DT10H59M"))?5
|
|
fn:months-from-duration(datetimedur);datetimedur?datetimedur to extract months component from;months-from-duration(xs:duration("P5Y10M2DT10H59M"))?10
|
|
fn:days-from-duration(datetimedur);datetimedur?datetimedur to extract days component from;days-from-duration(xs:duration("P5Y2DT10H59M"))?2
|
|
fn:hours-from-duration(datetimedur);datetimedur?datetimedur to extract hours component from;hours-from-duration(xs:duration("P5Y2DT10H59M"))?10
|
|
fn:minutes-from-duration(datetimedur);datetimedur?datetimedur to extract minute component from;years-from-duration(xs:duration("P5Y2DT10H59M"))?59
|
|
fn:seconds-from-duration(datetimedur);datetimedur?datetimedur to extract seconds component from;days-from-duration(xs:duration("P5Y2DT10H59M40S"))?40
|
|
fn:adjust-dateTime-to-timezone(datetime,timezone);datetime?datetime to be adjusted?timezone?timezone to be used in provided date;adjust-dateTime-to-timezone(xs:dateTime('2011-11-15T12:30:00-04:10'), xs:dayTimeDuration("PT10H"))?2011-11-16T02:40:00+10:00
|
|
fn:adjust-date-to-timezone(date,timezone);date?date to be adjusted?timezone?timezone to be imposed into date;adjust-date-to-timezone(xs:date('2011-11-15'), xs:dayTimeDuration("PT10H"))?2011-11-15+10:00
|
|
fn:timezone-from-date(date);date?date to extract timezone information from;timezone-from-date(xs:date("2011-11-15+11:00"))?PT1H?timezone-from-date(xs:date("2011-11-15+11:00"))?PT11H
|
|
fn:adjust-time-to-timezone(time,timezone);time?time to be adjusted?dayTimeDuration?timezone to be appended?adjust-time-to-timezone(xs:time("12:30:00"),xs:dayTimeDuration("PT11H"))?12:30:00+11:00
|
|
|
|
!SEQUENCE
|
|
fn:data(item.item,...);sequence*?sequence to be split to atomic values;data((1,2,23, "test"))?1 2 23 test
|
|
fn:insert-before((item,item,...),pos,inserts);Returns a new sequence constructed from the value of the item arguments
|
|
fn:min((arg,arg,...));sequence*?sequence to select minimum from;min((1,2,3))?1?min(('a', 'k'))?'a'
|
|
fn:avg((arg,arg,...));sequence*?returns average value of provided elements;avg((1,2,3))?2
|
|
fn:max((arg,arg,...));sequence*?sequence to select maximum from;max((1,2,3))?3?max(('a', 'k'))?'k'
|
|
fn:exactly-one(item,item,...);sequence?sequence to check;exactly-one((1))?1?exactly-one((1,1))?fn:exactly-one called with a sequence containing zero or more than one item.
|
|
fn:one-or-more(item,item,...);sequence?sequence to check;one-or-more((1, 2, 3))?1 2 3?one-or-more()?An empty sequence is not allowed as the first argument of fn:one-or-more()
|
|
fn:empty(item,item,...);sequence?sequence to check?empty(())?true?empty((1))?false?empty((1,2,3))?false
|
|
fn:distinct-values((item,item,...),collation);sequence?sequence to extract distinct values from;distinct-values((1, 2, 3, 1, 2))?(1, 2, 3)
|
|
fn:exists(item,item,...);Returns true if the value of the arguments IS NOT an empty sequence, otherwise it returns false?exists(remove(("ab"), 1))?false
|
|
|
|
|
|
!STRING
|
|
fn:upper-case(string);string?string to be converted to upper case;upper-case('aabbCC')?'AABBCC'
|
|
fn:lower-case(string);string?string to be converted to upper case;lower-case('aabbCC')?'aabbcc'
|
|
fn:string-join((string,string,...),sep);string*?string sequence to be joined?string?separator to be used;string-join(('fox', 'jumps', 'over', 'dog'), ' ')?' fox jumps over dog '?string-join(('fox', 'jumps', 'over', 'dog'))?'joxjumpsoverdog'
|
|
fn:string-to-codepoints(string);string?string to be coverted to list of unicode values;string-to-codepoints("test")?(116, 101, 115, 116)
|
|
fn:codepoints-to-string((int,int,...));int*?int sequence to be converted to string;codepoints-to-string((116, 101, 115, 116))?'test'
|
|
fn:compare(comp1,comp2);string?first parameter to be compared?string?second parameter to be compared;compare('abc', 'abc')?0?compare('abc', 'abd')?-1?compare('abc1', 'abd')?-1?compare("abc1","abc")?1
|
|
fn:compare(comp1,comp2,collation);string?first parameter to be compared?string?second parameter to be compared?string?collation to be used in comparison(letter weight may differ between languages);compare('ghi', 'ghi')?0
|
|
|
|
|
|
!NUMBER
|
|
|
|
fn:deep-equal(param1,param2,collation);
|
|
|
|
fn:default-collation();;
|
|
fn:codepoint-equal(comp1,comp2);int?unicode codepoint?int?unicode codepoint;codepoint-equal(111, 111)?true?codepoint-equal(111, 112)?false?codepoint-equal("111F", "111F")?true
|
|
|
|
|
|
fn:node-name(node);node?node to retrieve QName from;
|
|
|
|
fn:remove((item,item,...),position);sequence*?sequence to be modified?integer?position to insert element from;remove(("a","b","c"), 1)?b c?remove(("a","b","c"), 0)?a b c
|
|
fn:insert-before((item,item,...),position,inserts);sequence*?sequence to be modified?integer?position to insert items to?sequence*?sequence to be inserted?insert-before(("a","b","c"), 2 ,("xx"))?a xx b c
|
|
fn:reverse((item,item,...));sequence*?sequence of elements to have its order reversed;reverse(("ab", "cd", "ef"))?("ef", "cd", "ab")?reverse(("ab"))?("ab")
|
|
fn:static-base-uri();;default-collation()?http://www.w3.org/2005/xpath-functions/collation/codepoint
|
|
|
|
|
|
fn:root(node);node?node return root from;
|
|
|
|
fn:tokenize(string,pattern);string?string to be tokenized?string?string to be used to split the first argument;tokenize("fox jumps over dog", "\s+")?("fox", "jumps", "over", "dog")
|
|
fn:round-half-to-even(number);number?number to be rounded to nearest whole number;round-half-to-even(0.5)?0?round-half-to-even(1.5)?2?round-half-to-even(2.5)?2
|
|
fn:round-half-to-even(number, precision);number?number to be rounded to nearest whole number?number?precision to be used during rounding;round-half-to-even(1.54, 1)?1.5?
|
|
fn:abs(num);number?number to be converted to absolute value;abs(5)?5?abs(-5)?5
|
|
|
|
fn:matches(string,pattern);string?string to search in?string?pattern to be found;matches("Xpath", "pat")?true?matches("Xpath", "abc")?false
|
|
|
|
|
|
fn:document-uri(node);
|
|
|
|
!Math
|
|
math:acos(double);double?value to calculate arcus cosine for;acos(0)?1.5707963267948966?acos(1)?0
|
|
math:asin(double);double?value to calculate arcus sine for;asin(1)?1.5707963267948966?asin(0)?0
|
|
math:atan(double);double?value to calculate arcus tangent for;atan(0)?0?atan(10)?1.4711276743037347
|
|
math:atan2(double, double);double?x value?double?y value;atan2(1,1)?0.7853981633974483
|
|
math:cos(double);double?value to calculate cosine for;cos(0)?1?cos(3.14)?-1
|
|
math:exp(double);double?value to which power e should be raised;exp(1)?2.718281828459045?exp(10)?22026.465794806718
|
|
math:exp10(double);double?value to which power 10 should be raised;exp10(2)?100?exp10(20)?1.0E20
|
|
math:log(double);double?value for which to calculate a natural logarithm;log(1)?0?log(10)?2.302585092994046
|
|
math:log10(double);double?value for which to calculate a base-10 logarithm;log10(10)?1?log10(100)?2
|
|
math:pi();;pi()?3.141592653589793
|
|
math:pow(double, double);double?number to be raised?double?value of the power;pow(2,2)?4?pow(3,2)?9
|
|
math:sin(double);double?value to calculate sine for;sin(0)?0?sin(1)?0.8414709848078965
|
|
math:sqrt(double);double?value to calculate square root for;sqrt(9)?3?sqrt(1)?1.4142135623730951
|
|
math:tan(double);double?value to calculate tangent for;tan(0)?0?tan(1)?1.5574077246549023
|
|
|
|
|
|
!Loop / Conditional
|
|
fn:for-each(sequence*, function);sequence?sequence to run the function for?function?function to be perfomed on each element of sequence;for-each((1,2,3,4,5),function($a) { $a*$a })?1 4 9 16 25
|
|
fn:for-each-pair(sequence*, sequence*, function);sequence1?sequence to run the function for?sequenc2?sequence to run the function for?function?function to be perfomed on each element of sequence;for-each-pair((1,2,3,4,5), (1,2,3,4,5),function($a, $b) { $a+$b })?2 4 6 8 10
|
|
fn:fold-left(sequence*, baseValue, function);sequence?sequence to run the function for?item?a starting value for function?function?the function to be run for each consecutive element;fold-left((1,2,3), 0,function($a, $b) { ($a)-($b) })?-6
|
|
fn:fold-right();sequence?sequence to run the function for?item?a starting value for function?function?the function to be run for each consecutive element;fold-right((1,2,3), 0,function($a, $b) { ($a)-($b) })?2
|
|
fn:filter(sequence*, function);sequence?the sequence to be filtered?function?function to be used as filter;filter((1,2, 3, 4, 5),function($a) { ($a) > 3 })?4 5
|
|
|
|
fn:analyze-string(input, pattern);string?the string that is to be analized?string?regex?analyze-string("Word and whitespace", "\w+")?<analyze-string-result xmlns="http://www.w3.org/2005/xpath-functions"><br><match>Word</match><br><non-match> </non-match><br><match>and</match><non-match> </non-match><br><match>whitespace</match></analyze-string-result>
|
|
fn:available-environment-variables();;available-environment-variables()?PATH INVOCATION_ID XAUTHORITY LC_MEASUREMENT LC_TELEPHONE
|
|
fn:doc-available(uri);uri?the document to be checked
|
|
fn:element-with-id();;
|
|
fn:encode-for-uri(uri-part);string?string containing character to be escaped for uri
|
|
fn:environment-variable(name);string?the name of enviroment variable to return;environment-variable("GJS_DEBUG_OUTPUT")?stderr
|
|
fn:escape-html-uri(uri);;
|
|
|
|
fn:format-date(value, pattern);date?value to be formated?pattern?pattern to format the date in (also refered to as picture);format-date(xs:date("2021-03-31+02:00"), "[D]-[M]-[Y]")?31-3-2021
|
|
fn:format-dateTime(value, pattern);dateTime?value to be formated?pattern?pattern to format the dateTime in (also refered to as picture);format-dateTime(xs:dateTime("2021-03-31T17:55:54.004666+02:00"), "[D]-[M]-[Y] [H]:[m01]")?31-3-2021 17:55
|
|
fn:format-integer(value, pattern);integer?value to be formated?pattern?pattern to format the integer in (also refered to as picture);
|
|
fn:format-number(value, pattern);number?value to be formated?pattern?pattern to format the number in (also refered to as picture);
|
|
fn:format-time(value, pattern);time?value to be formated?pattern?pattern to format the time in (also refered to as picture);format-time(xs:time("17:57:07.473366+02:00"), "[H]:[m01]")
|
|
fn:function-arity(function);function?function for which to check number of parameters
|
|
fn:function-lookup(name, arity);;
|
|
fn:function-name();;
|
|
|
|
fn:has-children(node);node?node to be checked if has any children;NONE
|
|
fn:head(sequence);sequence?sequence from which the first element is to be retrieved;head((1, 2, 3))?1
|
|
fn:innermost(node);NONE
|
|
|
|
fn:iri-to-uri(iri);; |