Migrate https://phabricator.release11.com/diffusion/CZOPW/czopw.git to release11-tools-web
This commit is contained in:
9
.gitignore
vendored
Normal file
9
.gitignore
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
*.iml
|
||||
.classpath
|
||||
.idea/
|
||||
.project
|
||||
.settings
|
||||
.settings/
|
||||
.vscode
|
||||
nbactions.xml
|
||||
target/
|
||||
12
FunctionSet/3.0-3.1_changes
Normal file
12
FunctionSet/3.0-3.1_changes
Normal file
@@ -0,0 +1,12 @@
|
||||
XPath 3.0:
|
||||
Inline functions (kinda lambda)
|
||||
Dynamic function calls - function may be called without being referenced by name (find function in collection and call)
|
||||
Union types - collections containing elements of different types
|
||||
Namespace literals - Namespace may be embeded into function name
|
||||
New string concatenation operator '||'
|
||||
Mapping operator - '!' performs evaluation for each element in sequence and concatenates results
|
||||
|
||||
|
||||
XPath 3.1:
|
||||
Support for array and map data types
|
||||
New operator for function chaining - '=>'
|
||||
167
FunctionSet/XPath/1+2+3Examples
Normal file
167
FunctionSet/XPath/1+2+3Examples
Normal file
@@ -0,0 +1,167 @@
|
||||
!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);;
|
||||
121
FunctionSet/XPath/1+2Examples
Normal file
121
FunctionSet/XPath/1+2Examples
Normal file
@@ -0,0 +1,121 @@
|
||||
!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);
|
||||
|
||||
39
FunctionSet/XPath/10
Normal file
39
FunctionSet/XPath/10
Normal file
@@ -0,0 +1,39 @@
|
||||
!Node-Set
|
||||
fn:last();1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Node-Set-Functions;Returns the position of the last node in the context list
|
||||
fn:position();1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Node-Set-Functions;Returns the position of the current context node
|
||||
fn:count(node-set);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Node-Set-Functions;Returns the number of nodes in the node-set
|
||||
fn:id(object);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Node-Set-Functions;Returns the element specified by it's unique id, requires DTD
|
||||
fn:local-name(node-set);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Node-Set-Functions;Returns the local-name for the first node in the node-set
|
||||
fn:local-name();1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Node-Set-Functions;Returns the local-name for the context node
|
||||
fn:namespace-uri(node-set);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Node-Set-Functions;Returns the namespace-uri for the first node in the node-set
|
||||
fn:namespace-uri();1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Node-Set-Functions;Returns the namespace-uri for the context node
|
||||
fn:name(node-set);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Node-Set-Functions;Returns the name for the first node in the node-set
|
||||
fn:name();1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Node-Set-Functions;Returns the name for the context node
|
||||
!String
|
||||
fn:string(object);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions;Returns the string representation of the object argument
|
||||
fn:string();1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions;Returns a string value representation of the context node
|
||||
fn:concat(string, string, string*);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions;Returns the concatenation of its arguments
|
||||
fn:starts-with(string, string);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions;Returns true if the first string starts with the second string
|
||||
fn:contains(string, string);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions;Returns true if the first string contains the second string
|
||||
fn:substring-before(string, string);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions;Returns the substring found before the first occurrence of the second argument
|
||||
fn:substring-after(string, string);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions;Returns the substring found after the first occurrence of the second argument
|
||||
fn:substring(string, number, number);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions;Returns the substring starting at second argument with lenght of third argument
|
||||
fn:substring(string, number);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions;Returns the substring of the first argument from the position specified by the second argument
|
||||
fn:string-length(string);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions;Returns the length of the string specified by the argument
|
||||
fn:string-length();1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions;Returns the length of the string specified by the context node
|
||||
fn:normalize-space(string);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions;Returns a white-space normalized string
|
||||
fn:normalize-space();1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions;Returns a white-space normalized string specified by the context-node
|
||||
fn:translate(string, string, string);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions;Replaces characters specified by the second argument using those from the third argument
|
||||
!Boolean
|
||||
fn:boolean(object);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Boolean-Functions;Returns the boolean representation of the object argument
|
||||
fn:not(boolean);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Boolean-Functions;Returns a boolean with the opposite value of its argument
|
||||
fn:true();1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Boolean-Functions;Returns a boolean with the value of true
|
||||
fn:false();1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Boolean-Functions;Returns a boolean with the value of false
|
||||
fn:lang(string);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Boolean-Functions;Returns true if the language of the context node is the same as the languag specified by the argument
|
||||
!Number
|
||||
fn:number(object);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Number-Functions;Returns the number representation of the object argument
|
||||
fn:number();1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Number-Functions;Returns the number representation of the context node
|
||||
fn:sum(node-set);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Number-Functions;Returns the sum of all nodes in the node-set
|
||||
fn:floor(number);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Number-Functions;Returns the largest integer value not greater than the argument
|
||||
fn:ceiling(number);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Number-Functions;Returns the smallest integer value not less than the argument
|
||||
fn:round(number);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Number-Functions;Returns the integer value closest to the argument
|
||||
130
FunctionSet/XPath/10+20
Normal file
130
FunctionSet/XPath/10+20
Normal file
@@ -0,0 +1,130 @@
|
||||
!Node-Set
|
||||
fn:last();1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Node-Set-Functions;Returns the position of the last node in the context list
|
||||
fn:position();1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Node-Set-Functions;Returns the position of the current context node
|
||||
fn:count(node-set);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Node-Set-Functions;Returns the number of nodes in the node-set
|
||||
fn:id(object);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Node-Set-Functions;Returns the element specified by it's unique id, requires DTD
|
||||
fn:local-name(node-set);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Node-Set-Functions;Returns the local-name for the first node in the node-set
|
||||
fn:local-name();1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Node-Set-Functions;Returns the local-name for the context node
|
||||
fn:namespace-uri(node-set);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Node-Set-Functions;Returns the namespace-uri for the first node in the node-set
|
||||
fn:namespace-uri();1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Node-Set-Functions;Returns the namespace-uri for the context node
|
||||
fn:name(node-set);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Node-Set-Functions;Returns the name for the first node in the node-set
|
||||
fn:name();1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Node-Set-Functions;Returns the name for the context node
|
||||
!String
|
||||
fn:string(object);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions;Returns the string representation of the object argument
|
||||
fn:string();1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions;Returns a string value representation of the context node
|
||||
fn:concat(string, string, string*);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions;Returns the concatenation of its arguments
|
||||
fn:starts-with(string, string);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions;Returns true if the first string starts with the second string
|
||||
fn:contains(string, string);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions;Returns true if the first string contains the second string
|
||||
fn:substring-before(string, string);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions;Returns the substring found before the first occurrence of the second argument
|
||||
fn:substring-after(string, string);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions;Returns the substring found after the first occurrence of the second argument
|
||||
fn:substring(string, number, number);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions;Returns the substring starting at second argument with lenght of third argument
|
||||
fn:substring(string, number);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions;Returns the substring of the first argument from the position specified by the second argument
|
||||
fn:string-length(string);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions;Returns the length of the string specified by the argument
|
||||
fn:string-length();1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions;Returns the length of the string specified by the context node
|
||||
fn:normalize-space(string);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions;Returns a white-space normalized string
|
||||
fn:normalize-space();1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions;Returns a white-space normalized string specified by the context-node
|
||||
fn:translate(string, string, string);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions;Replaces characters specified by the second argument using those from the third argument
|
||||
fn:string-join((string,string,...),sep);2.0;https://www.w3.org/TR/xpath-functions/#func-string-join;Returns a string created by concatenating the string arguments and using the sep argument as the separator
|
||||
fn:string-to-codepoints(string);2.0;https://www.w3.org/TR/xpath-functions/#func-string-to-codepoints;Returns the sequence of the Unicode standard code points from a string
|
||||
fn:compare(comp1,comp2);2.0;https://www.w3.org/TR/xpath-functions/#func-compare;Returns -1 if comp1 is less than comp2, 0 if comp1 is equal to comp2, or 1 if comp1 is greater than comp2 (according to the rules of the collation that is used)
|
||||
fn:compare(comp1,comp2,collation);2.0;https://www.w3.org/TR/xpath-functions/#func-compare;Returns -1 if comp1 is less than comp2, 0 if comp1 is equal to comp2, or 1 if comp1 is greater than comp2 (according to the rules of the collation that is used)
|
||||
fn:codepoints-to-string((int,int,...));2.0;https://www.w3.org/TR/xpath-functions/#func-codepoints-to-string;Creates a string from a sequence of the Unicode Standard code points
|
||||
fn:codepoint-equal(comp1,comp2);2.0;https://www.w3.org/TR/xpath-functions/#func-codepoint-equal;Returns true if the value of comp1 is equal to the value of comp2, according to the Unicode code point collation (http://www.w3.org/2005/02/xpath-functions/collation/codepoint), otherwise it returns false
|
||||
fn:normalize-unicode();2.0;https://www.w3.org/TR/xpath-functions/#func-normalize-unicode;NONE
|
||||
fn:upper-case(string);2.0;https://www.w3.org/TR/xpath-functions/#func-upper-case;Converts the string argument to upper-case
|
||||
fn:lower-case(string);2.0;https://www.w3.org/TR/xpath-functions/#func-lower-case;Converts the string argument to lower-case
|
||||
fn:escape-uri(stringURI,esc-res);2.0;https://www.w3.org/TR/xpath-functions/#func-escape-uri;
|
||||
fn:tokenize(string,pattern);2.0;https://www.w3.org/TR/xpath-functions/#func-tokenize;
|
||||
fn:matches(string,pattern);2.0;https://www.w3.org/TR/xpath-functions/#func-matches;Returns true if the string argument matches the pattern, otherwise, it returns false
|
||||
fn:replace(string,pattern,replace);2.0;https://www.w3.org/TR/xpath-functions/#func-replace;Returns a string that is created by replacing the given pattern with the replace argument
|
||||
fn:ends-with(string1,string2);2.0;https://www.w3.org/TR/xpath-functions/#func-ends-with;Returns true if string1 ends with string2, otherwise it returns false
|
||||
!Boolean
|
||||
fn:boolean(object);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Boolean-Functions;Returns the boolean representation of the object argument
|
||||
fn:not(boolean);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Boolean-Functions;Returns a boolean with the opposite value of its argument
|
||||
fn:true();1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Boolean-Functions;Returns a boolean with the value of true
|
||||
fn:false();1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Boolean-Functions;Returns a boolean with the value of false
|
||||
fn:lang(string);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Boolean-Functions;Returns true if the language of the context node is the same as the languag specified by the argument
|
||||
!Number
|
||||
fn:number(object);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Number-Functions;Returns the number representation of the object argument
|
||||
fn:number();1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Number-Functions;Returns the number representation of the context node
|
||||
fn:sum(node-set);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Number-Functions;Returns the sum of all nodes in the node-set
|
||||
fn:floor(number);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Number-Functions;Returns the largest integer value not greater than the argument
|
||||
fn:ceiling(number);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Number-Functions;Returns the smallest integer value not less than the argument
|
||||
fn:round(number);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Number-Functions;Returns the integer value closest to the argument
|
||||
fn:round-half-to-even();2.0;https://www.w3.org/TR/xpath-functions/#func-round-half-to-even;
|
||||
fn:abs(num);2.0;https://www.w3.org/TR/xpath-functions/#func-abs;Returns the absolute value of the argument
|
||||
!Date / Time
|
||||
fn:adjust-date-to-timezone(date,timezone);2.0;https://www.w3.org/TR/xpath-functions/#func-adjust-date-to-timezone;If the timezone argument is empty, it returns a date without a timezone. Otherwise, it returns a date with a timezone
|
||||
fn:adjust-time-to-timezone(time,timezone);2.0;https://www.w3.org/TR/xpath-functions/#func-adjust-time-to-timezone;If the timezone argument is empty, it returns a time without a timezone. Otherwise, it returns a time with a timezone
|
||||
fn:implicit-timezone();2.0;https://www.w3.org/TR/xpath-functions/#func-implicit-timezone;Returns the value of the implicit timezone
|
||||
fn:dateTime(date,time);2.0;https://www.w3.org/TR/xpath-functions/#func-dateTime;Converts the arguments to a date and a time
|
||||
fn:current-time();2.0;https://www.w3.org/TR/xpath-functions/#func-current-time;Returns the current time (with timezone)
|
||||
fn:timezone-from-time(time);2.0;https://www.w3.org/TR/xpath-functions/#func-timezone-from-time;Returns the time zone component of the argument if any
|
||||
fn:hours-from-time(time);2.0;https://www.w3.org/TR/xpath-functions/#func-hours-from-time;Returns an integer that represents the hours component in the localized value of the argument
|
||||
fn:minutes-from-time(time);2.0;https://www.w3.org/TR/xpath-functions/#func-minutes-from-time;Returns an integer that represents the minutes component in the localized value of the argument
|
||||
fn:seconds-from-time(time);2.0;https://www.w3.org/TR/xpath-functions/#func-seconds-from-time;Returns an integer that represents the seconds component in the localized value of the argument
|
||||
fn:years-from-duration(datetimedur);2.0;https://www.w3.org/TR/xpath-functions/#func-years-from-duration;Returns an integer that represents the years component in the canonical lexical representation of the value of the argument
|
||||
fn:months-from-duration(datetimedur);2.0;https://www.w3.org/TR/xpath-functions/#func-years-from-duration;Returns an integer that represents the months component in the canonical lexical representation of the value of the argument
|
||||
fn:days-from-duration(datetimedur);2.0;https://www.w3.org/TR/xpath-functions/#func-days-from-duration;Returns an integer that represents the days component in the canonical lexical representation of the value of the argument
|
||||
fn:hours-from-duration(datetimedur);2.0;https://www.w3.org/TR/xpath-functions/#func-hours-from-duration;Returns an integer that represents the hours component in the canonical lexical representation of the value of the argument
|
||||
fn:minutes-from-duration(datetimedur);2.0;https://www.w3.org/TR/xpath-functions/#func-minutes-from-duration;Returns an integer that represents the minutes component in the canonical lexical representation of the value of the argument
|
||||
fn:seconds-from-duration(datetimedur);2.0;https://www.w3.org/TR/xpath-functions/#func-seconds-from-duration;Returns a decimal that represents the seconds component in the canonical lexical representation of the value of the argument
|
||||
fn:current-date();2.0;https://www.w3.org/TR/xpath-functions/#func-current-date;Returns the current date (with timezone)
|
||||
fn:timezone-from-date(date);2.0;https://www.w3.org/TR/xpath-functions/#func-timezone-from-date;Returns the time zone component of the argument if any
|
||||
fn:year-from-date(date);2.0;https://www.w3.org/TR/xpath-functions/#func-year-from-date;Returns an integer that represents the year in the localized value of the argument
|
||||
fn:month-from-date(date);2.0;https://www.w3.org/TR/xpath-functions/#func-month-from-date;Returns an integer that represents the month in the localized value of the argument
|
||||
fn:day-from-date(date);2.0;https://www.w3.org/TR/xpath-functions/#func-day-from-date;Returns an integer that represents the day in the localized value of the argument
|
||||
fn:current-dateTime();2.0;https://www.w3.org/TR/xpath-functions/#func-current-dateTime;Returns the current dateTime (with timezone)
|
||||
fn:timezone-from-dateTime(datetime);2.0;https://www.w3.org/TR/xpath-functions/#func-timezone-from-dateTime;Returns the time zone component of the argument if any
|
||||
fn:year-from-dateTime(datetime);2.0;https://www.w3.org/TR/xpath-functions/#func-year-from-dateTime;Returns an integer that represents the year component in the localized value of the argument
|
||||
fn:month-from-dateTime(datetime);2.0;https://www.w3.org/TR/xpath-functions/#func-month-from-dateTime;Returns an integer that represents the month component in the localized value of the argument
|
||||
fn:day-from-dateTime(datetime);2.0;https://www.w3.org/TR/xpath-functions/#func-day-from-dateTime;Returns an integer that represents the day component in the localized value of the argument
|
||||
fn:hours-from-dateTime(datetime);2.0;https://www.w3.org/TR/xpath-functions/#func-hours-from-dateTime;Returns an integer that represents the hours component in the localized value of the argument
|
||||
fn:minutes-from-dateTime(datetime);2.0;https://www.w3.org/TR/xpath-functions/#func-minutes-from-dateTime;Returns an integer that represents the minutes component in the localized value of the argument
|
||||
fn:seconds-from-dateTime(datetime);2.0;https://www.w3.org/TR/xpath-functions/#func-seconds-from-dateTime;Returns a decimal that represents the seconds component in the localized value of the argument
|
||||
fn:adjust-dateTime-to-timezone(datetime,timezone);2.0;https://www.w3.org/TR/xpath-functions/#func-adjust-dateTime-to-timezone;If the timezone argument is empty, it returns a dateTime without a timezone. Otherwise, it returns a dateTime with a timezone
|
||||
!Collections
|
||||
fn:avg((arg,arg,...));2.0;https://www.w3.org/TR/xpath-functions/#func-avg;Returns the average of the argument values
|
||||
fn:exactly-one(item,item,...);2.0;https://www.w3.org/TR/xpath-functions/#func-exactly-one;Returns the argument if it contains exactly one item, otherwise it raises an error
|
||||
fn:zero-or-one(item,item,...);2.0;https://www.w3.org/TR/xpath-functions/#func-zero-or-one;Returns the argument if it contains zero or one items, otherwise it raises an error
|
||||
fn:index-of((item,item,...),searchitem);2.0;https://www.w3.org/TR/xpath-functions/#func-index-of;Returns the positions within the sequence of items that are equal to the searchitem argument
|
||||
fn:reverse((item,item,...));2.0;https://www.w3.org/TR/xpath-functions/#func-reverse;Returns the reversed order of the items specified
|
||||
fn:one-or-more(item,item,...);2.0;https://www.w3.org/TR/xpath-functions/#func-one-or-more;Returns the argument if it contains one or more items, otherwise it raises an error
|
||||
fn:distinct-values((item,item,...),collation);2.0;https://www.w3.org/TR/xpath-functions/#func-distinct-values;Returns only distinct (different) values
|
||||
fn:exists(item,item,...);2.0;https://www.w3.org/TR/xpath-functions/#func-exists;Returns true if the value of the arguments IS NOT an empty sequence, otherwise it returns false
|
||||
fn:subsequence((item,item,...),start,len);2.0;https://www.w3.org/TR/xpath-functions/#func-subsequence;Returns a sequence of items from the position specified by the start argument and continuing for the number of items specified by the len argument. The first item is located at position 1
|
||||
fn:empty(item,item,...);2.0;https://www.w3.org/TR/xpath-functions/#func-empty;Returns true if the value of the arguments IS an empty sequence, otherwise it returns false
|
||||
fn:insert-before((item,item,...),pos,inserts);2.0;https://www.w3.org/TR/xpath-functions/#func-insert-before;Returns a new sequence constructed from the value of the item arguments
|
||||
fn:remove((item,item,...),position);2.0;https://www.w3.org/TR/xpath-functions/#func-remove;Returns a new sequence constructed from the value of the item arguments
|
||||
fn:unordered((item,item,...));2.0;https://www.w3.org/TR/xpath-functions/#func-unordered;Returns the items in an implementation dependent order
|
||||
fn:data(item.item,...);2.0;https://www.w3.org/TR/xpath-functions/#func-data;Takes a sequence of items and returns a sequence of atomic values
|
||||
fn:collection();2.0;https://www.w3.org/TR/xpath-functions/#func-collection;NONE
|
||||
fn:collection(string);2.0;https://www.w3.org/TR/xpath-functions/#func-collection;NONE
|
||||
fn:min((arg,arg,...));2.0;https://www.w3.org/TR/xpath-functions/#func-min;Returns the argument that is less than the others
|
||||
fn:max((arg,arg,...));2.0;https://www.w3.org/TR/xpath-functions/#func-max;Returns the argument that is greater than the others
|
||||
fn:deep-equal(param1,param2,collation);2.0;https://www.w3.org/TR/xpath-functions/#func-deep-equal;Returns true if param1 and param2 are deep-equal to each other, otherwise it returns false
|
||||
!Error
|
||||
fn:error();2.0;https://www.w3.org/TR/xpath-functions/#func-error;
|
||||
fn:error(error);2.0;https://www.w3.org/TR/xpath-functions/#func-error;
|
||||
fn:error(error,description);2.0;https://www.w3.org/TR/xpath-functions/#func-error;
|
||||
fn:error(error,description,error-object);2.0;https://www.w3.org/TR/xpath-functions/#func-error;
|
||||
fn:trace(value,label);2.0;https://www.w3.org/TR/xpath-functions/#func-trace;Used to debug queries
|
||||
!Misc
|
||||
fn:nilled(node);2.0;https://www.w3.org/TR/xpath-functions/#func-nilled;Returns a Boolean value indicating whether the argument node is nilled
|
||||
fn:namespace-uri-from-QName();2.0;https://www.w3.org/TR/xpath-functions/#func-namespace-uri-from-QName;NONE
|
||||
fn:base-uri();2.0;https://www.w3.org/TR/xpath-functions/#func-base-uri;Returns the value of the base-uri property of the current or specified node
|
||||
fn:base-uri(node);2.0;https://www.w3.org/TR/xpath-functions/#func-base-uri;Returns the value of the base-uri property of the current or specified node
|
||||
fn:static-base-uri();2.0;https://www.w3.org/TR/xpath-functions/#func-static-base-uri;Returns the value of the base-uri
|
||||
fn:doc-available(URI);2.0;https://www.w3.org/TR/xpath-functions/#func-doc-available;Returns true if the doc() function returns a document node, otherwise it returns false
|
||||
fn:resolve-QName();2.0;https://www.w3.org/TR/xpath-functions/#func-resolve-QName;NONE
|
||||
fn:node-name(node);2.0;https://www.w3.org/TR/xpath-functions/#func-node-name;Returns the node-name of the argument node
|
||||
fn:default-collation();2.0;https://www.w3.org/TR/xpath-functions/#func-default-collation;Returns the value of the default collation
|
||||
fn:idref((string,string,...),node);2.0;https://www.w3.org/TR/xpath-functions/#func-idref;Returns a sequence of element or attribute nodes that have an IDREF value equal to the value of one or more of the values specified in the string argument
|
||||
fn:document-uri(node);2.0;https://www.w3.org/TR/xpath-functions/#func-document-uri;Returns the value of the document-uri property for the specified node
|
||||
fn:local-name-from-QName();2.0;https://www.w3.org/TR/xpath-functions/#func-local-name-from-QName;NONE
|
||||
fn:in-scope-prefixes();2.0;https://www.w3.org/TR/xpath-functions/#func-in-scope-prefixes;NONE
|
||||
fn:namespace-uri-for-prefix();2.0;https://www.w3.org/TR/xpath-functions/#func-namespace-uri-for-prefix;NONE
|
||||
fn:QName();2.0;https://www.w3.org/TR/xpath-functions/#func-QName;NONE
|
||||
fn:root() fn:root(node);2.0;https://www.w3.org/TR/xpath-functions/#func-root;Returns the root of the tree to which the current node or the specified belongs. This will usually be a document node
|
||||
fn:doc(URI);2.0;https://www.w3.org/TR/xpath-functions/#func-doc;NONE
|
||||
fn:resolve-uri(relative,base);2.0;https://www.w3.org/TR/xpath-functions/#func-resolve-uri;NONE
|
||||
128
FunctionSet/XPath/10+20+30
Normal file
128
FunctionSet/XPath/10+20+30
Normal file
@@ -0,0 +1,128 @@
|
||||
!Node-Set
|
||||
fn:last();1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Node-Set-Functions;Returns the position of the last node in the context list
|
||||
fn:position();1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Node-Set-Functions;Returns the position of the current context node
|
||||
fn:count(node-set);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Node-Set-Functions;Returns the number of nodes in the node-set
|
||||
fn:id(object);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Node-Set-Functions;Returns the element specified by it's unique id, requires DTD
|
||||
fn:local-name(node-set);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Node-Set-Functions;Returns the local-name for the first node in the node-set
|
||||
fn:local-name();1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Node-Set-Functions;Returns the local-name for the context node
|
||||
fn:namespace-uri(node-set);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Node-Set-Functions;Returns the namespace-uri for the first node in the node-set
|
||||
fn:namespace-uri();1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Node-Set-Functions;Returns the namespace-uri for the context node
|
||||
fn:name(node-set);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Node-Set-Functions;Returns the name for the first node in the node-set
|
||||
fn:name();1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Node-Set-Functions;Returns the name for the context node
|
||||
!String
|
||||
fn:string(object);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions;Returns the string representation of the object argument
|
||||
fn:string();1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions;Returns a string value representation of the context node
|
||||
fn:concat(string, string, string*);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions;Returns the concatenation of its arguments
|
||||
fn:starts-with(string, string);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions;Returns true if the first string starts with the second string
|
||||
fn:contains(string, string);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions;Returns true if the first string contains the second string
|
||||
fn:substring-before(string, string);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions;Returns the substring found before the first occurrence of the second argument
|
||||
fn:substring-after(string, string);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions;Returns the substring found after the first occurrence of the second argument
|
||||
fn:substring(string, number, number);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions;Returns the substring starting at second argument with lenght of third argument
|
||||
fn:substring(string, number);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions;Returns the substring of the first argument from the position specified by the second argument
|
||||
fn:string-length(string);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions;Returns the length of the string specified by the argument
|
||||
fn:string-length();1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions;Returns the length of the string specified by the context node
|
||||
fn:normalize-space(string);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions;Returns a white-space normalized string
|
||||
fn:normalize-space();1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions;Returns a white-space normalized string specified by the context-node
|
||||
fn:translate(string, string, string);1.0;https://www.w3.org/TR/1999/REC-xpath-19991116/#section-String-Functions;Replaces characters specified by the second argument using those from the third argument
|
||||
fn:string-join((string,string,...),sep);2.0;https://www.w3.org/TR/xpath-functions/#func-string-join;Returns a string created by concatenating the string arguments and using the sep argument as the separator
|
||||
fn:string-to-codepoints(string);3.0;https://www.w3.org/TR/xpath-functions-31/#func-string-to-codepoints;Returns sequence of unicode codepoint representing the provided string
|
||||
fn:compare(comp1,comp2);2.0;https://www.w3.org/TR/xpath-functions/#func-compare;Returns -1 if comp1 is less than comp2, 0 if comp1 is equal to comp2, or 1 if comp1 is greater than comp2 (according to the rules of the collation that is used)
|
||||
fn:compare(comp1,comp2,collation);2.0;https://www.w3.org/TR/xpath-functions/#func-compare;Returns -1 if comp1 is less than comp2, 0 if comp1 is equal to comp2, or 1 if comp1 is greater than comp2 (according to the rules of the collation that is used)
|
||||
fn:codepoints-to-string((int,int,...));2.0;https://www.w3.org/TR/xpath-functions/#func-codepoints-to-string;Creates a string from a sequence of the Unicode Standard code points
|
||||
fn:codepoint-equal(comp1,comp2);2.0;https://www.w3.org/TR/xpath-functions/#func-codepoint-equal;Returns true if the value of comp1 is equal to the value of comp2, according to the Unicode code point collation (http://www.w3.org/2005/02/xpath-functions/collation/codepoint), otherwise it returns false
|
||||
fn:normalize-unicode();2.0;https://www.w3.org/TR/xpath-functions/#func-normalize-unicode;NONE
|
||||
fn:upper-case(string);2.0;https://www.w3.org/TR/xpath-functions/#func-upper-case;Converts the string argument to upper-case
|
||||
fn:lower-case(string);2.0;https://www.w3.org/TR/xpath-functions/#func-lower-case;Converts the string argument to lower-case
|
||||
fn:escape-uri(stringURI,esc-res);2.0;https://www.w3.org/TR/xpath-functions/#func-escape-uri;
|
||||
fn:tokenize(string,pattern);2.0;https://www.w3.org/TR/xpath-functions/#func-tokenize;
|
||||
fn:matches(string,pattern);2.0;https://www.w3.org/TR/xpath-functions/#func-matches;Returns true if the string argument matches the pattern, otherwise, it returns false
|
||||
fn:replace(string,pattern,replace);2.0;https://www.w3.org/TR/xpath-functions/#func-replace;Returns a string that is created by replacing the given pattern with the replace argument
|
||||
fn:ends-with(string1,string2);2.0;https://www.w3.org/TR/xpath-functions/#func-ends-with;Returns true if string1 ends with string2, otherwise it returns false
|
||||
!Collections
|
||||
fn:avg((arg,arg,...));2.0;https://www.w3.org/TR/xpath-functions/#func-avg;Returns the average of the argument values
|
||||
fn:exactly-one(item,item,...);2.0;https://www.w3.org/TR/xpath-functions/#func-exactly-one;Returns the argument if it contains exactly one item, otherwise it raises an error
|
||||
fn:zero-or-one(item,item,...);2.0;https://www.w3.org/TR/xpath-functions/#func-zero-or-one;Returns the argument if it contains zero or one items, otherwise it raises an error
|
||||
fn:index-of((item,item,...),searchitem);2.0;https://www.w3.org/TR/xpath-functions/#func-index-of;Returns the positions within the sequence of items that are equal to the searchitem argument
|
||||
fn:reverse((item,item,...));2.0;https://www.w3.org/TR/xpath-functions/#func-reverse;Returns the reversed order of the items specified
|
||||
fn:one-or-more(item,item,...);2.0;https://www.w3.org/TR/xpath-functions/#func-one-or-more;Returns the argument if it contains one or more items, otherwise it raises an error
|
||||
fn:distinct-values((item,item,...),collation);2.0;https://www.w3.org/TR/xpath-functions/#func-distinct-values;Returns only distinct (different) values
|
||||
fn:exists(item,item,...);2.0;https://www.w3.org/TR/xpath-functions/#func-exists;Returns true if the value of the arguments IS NOT an empty sequence, otherwise it returns false
|
||||
fn:subsequence((item,item,...),start,len);2.0;https://www.w3.org/TR/xpath-functions/#func-subsequence;Returns a sequence of items from the position specified by the start argument and continuing for the number of items specified by the len argument. The first item is located at position 1
|
||||
fn:empty(item,item,...);2.0;https://www.w3.org/TR/xpath-functions/#func-empty;Returns true if the value of the arguments IS an empty sequence, otherwise it returns false
|
||||
fn:insert-before((item,item,...),pos,inserts);2.0;https://www.w3.org/TR/xpath-functions/#func-insert-before;Returns a new sequence constructed from the value of the item arguments
|
||||
fn:remove((item,item,...),position);2.0;https://www.w3.org/TR/xpath-functions/#func-remove;Returns a new sequence constructed from the value of the item arguments
|
||||
fn:unordered((item,item,...));2.0;https://www.w3.org/TR/xpath-functions/#func-unordered;Returns the items in an implementation dependent order
|
||||
fn:data(item.item,...);2.0;https://www.w3.org/TR/xpath-functions/#func-data;Takes a sequence of items and returns a sequence of atomic values
|
||||
fn:collection();2.0;https://www.w3.org/TR/xpath-functions/#func-collection;NONE
|
||||
fn:collection(string);2.0;https://www.w3.org/TR/xpath-functions/#func-collection;NONE
|
||||
fn:min((arg,arg,...));2.0;https://www.w3.org/TR/xpath-functions/#func-min;Returns the argument that is less than the others
|
||||
fn:max((arg,arg,...));2.0;https://www.w3.org/TR/xpath-functions/#func-max;Returns the argument that is greater than the others
|
||||
fn:deep-equal(param1,param2,collation);2.0;https://www.w3.org/TR/xpath-functions/#func-deep-equal;Returns true if param1 and param2 are deep-equal to each other, otherwise it returns false
|
||||
!Date / Time
|
||||
fn:adjust-date-to-timezone(date,timezone);2.0;https://www.w3.org/TR/xpath-functions/#func-adjust-date-to-timezone;If the timezone argument is empty, it returns a date without a timezone. Otherwise, it returns a date with a timezone
|
||||
fn:adjust-time-to-timezone(time,timezone);2.0;https://www.w3.org/TR/xpath-functions/#func-adjust-time-to-timezone;If the timezone argument is empty, it returns a time without a timezone. Otherwise, it returns a time with a timezone
|
||||
fn:implicit-timezone();2.0;https://www.w3.org/TR/xpath-functions/#func-implicit-timezone;Returns the value of the implicit timezone
|
||||
fn:dateTime(date,time);2.0;https://www.w3.org/TR/xpath-functions/#func-dateTime;Converts the arguments to a date and a time
|
||||
fn:current-time();2.0;https://www.w3.org/TR/xpath-functions/#func-current-time;Returns the current time (with timezone)
|
||||
fn:timezone-from-time(time);2.0;https://www.w3.org/TR/xpath-functions/#func-timezone-from-time;Returns the time zone component of the argument if any
|
||||
fn:hours-from-time(time);2.0;https://www.w3.org/TR/xpath-functions/#func-hours-from-time;Returns an integer that represents the hours component in the localized value of the argument
|
||||
fn:minutes-from-time(time);2.0;https://www.w3.org/TR/xpath-functions/#func-minutes-from-time;Returns an integer that represents the minutes component in the localized value of the argument
|
||||
fn:seconds-from-time(time);2.0;https://www.w3.org/TR/xpath-functions/#func-seconds-from-time;Returns an integer that represents the seconds component in the localized value of the argument
|
||||
fn:years-from-duration(datetimedur);2.0;https://www.w3.org/TR/xpath-functions/#func-years-from-duration;Returns an integer that represents the years component in the canonical lexical representation of the value of the argument
|
||||
fn:months-from-duration(datetimedur);2.0;https://www.w3.org/TR/xpath-functions/#func-years-from-duration;Returns an integer that represents the months component in the canonical lexical representation of the value of the argument
|
||||
fn:days-from-duration(datetimedur);2.0;https://www.w3.org/TR/xpath-functions/#func-days-from-duration;Returns an integer that represents the days component in the canonical lexical representation of the value of the argument
|
||||
fn:hours-from-duration(datetimedur);2.0;https://www.w3.org/TR/xpath-functions/#func-hours-from-duration;Returns an integer that represents the hours component in the canonical lexical representation of the value of the argument
|
||||
fn:minutes-from-duration(datetimedur);2.0;https://www.w3.org/TR/xpath-functions/#func-minutes-from-duration;Returns an integer that represents the minutes component in the canonical lexical representation of the value of the argument
|
||||
fn:seconds-from-duration(datetimedur);2.0;https://www.w3.org/TR/xpath-functions/#func-seconds-from-duration;Returns a decimal that represents the seconds component in the canonical lexical representation of the value of the argument
|
||||
fn:current-date();2.0;https://www.w3.org/TR/xpath-functions/#func-current-date;Returns the current date (with timezone)
|
||||
fn:timezone-from-date(date);2.0;https://www.w3.org/TR/xpath-functions/#func-timezone-from-date;Returns the time zone component of the argument if any
|
||||
fn:year-from-date(date);2.0;https://www.w3.org/TR/xpath-functions/#func-year-from-date;Returns an integer that represents the year in the localized value of the argument
|
||||
fn:month-from-date(date);2.0;https://www.w3.org/TR/xpath-functions/#func-month-from-date;Returns an integer that represents the month in the localized value of the argument
|
||||
fn:day-from-date(date);2.0;https://www.w3.org/TR/xpath-functions/#func-day-from-date;Returns an integer that represents the day in the localized value of the argument
|
||||
fn:current-dateTime();2.0;https://www.w3.org/TR/xpath-functions/#func-current-dateTime;Returns the current dateTime (with timezone)
|
||||
fn:timezone-from-dateTime(datetime);2.0;https://www.w3.org/TR/xpath-functions/#func-timezone-from-dateTime;Returns the time zone component of the argument if any
|
||||
fn:year-from-dateTime(datetime);2.0;https://www.w3.org/TR/xpath-functions/#func-year-from-dateTime;Returns an integer that represents the year component in the localized value of the argument
|
||||
fn:month-from-dateTime(datetime);2.0;https://www.w3.org/TR/xpath-functions/#func-month-from-dateTime;Returns an integer that represents the month component in the localized value of the argument
|
||||
fn:day-from-dateTime(datetime);2.0;https://www.w3.org/TR/xpath-functions/#func-day-from-dateTime;Returns an integer that represents the day component in the localized value of the argument
|
||||
fn:hours-from-dateTime(datetime);2.0;https://www.w3.org/TR/xpath-functions/#func-hours-from-dateTime;Returns an integer that represents the hours component in the localized value of the argument
|
||||
fn:minutes-from-dateTime(datetime);2.0;https://www.w3.org/TR/xpath-functions/#func-minutes-from-dateTime;Returns an integer that represents the minutes component in the localized value of the argument
|
||||
fn:seconds-from-dateTime(datetime);2.0;https://www.w3.org/TR/xpath-functions/#func-seconds-from-dateTime;Returns a decimal that represents the seconds component in the localized value of the argument
|
||||
fn:adjust-dateTime-to-timezone(datetime,timezone);2.0;https://www.w3.org/TR/xpath-functions/#func-adjust-dateTime-to-timezone;If the timezone argument is empty, it returns a dateTime without a timezone. Otherwise, it returns a dateTime with a timezone
|
||||
!Error
|
||||
fn:error();2.0;https://www.w3.org/TR/xpath-functions/#func-error;
|
||||
fn:error(error);2.0;https://www.w3.org/TR/xpath-functions/#func-error;
|
||||
fn:error(error,description);2.0;https://www.w3.org/TR/xpath-functions/#func-error;
|
||||
fn:error(error,description,error-object);2.0;https://www.w3.org/TR/xpath-functions/#func-error;
|
||||
fn:trace(value,label);2.0;https://www.w3.org/TR/xpath-functions/#func-trace;Used to debug queries
|
||||
!Misc
|
||||
fn:nilled(node);2.0;https://www.w3.org/TR/xpath-functions/#func-nilled;Returns a Boolean value indicating whether the argument node is nilled
|
||||
fn:namespace-uri-from-QName();2.0;https://www.w3.org/TR/xpath-functions/#func-namespace-uri-from-QName;NONE
|
||||
fn:base-uri();2.0;https://www.w3.org/TR/xpath-functions/#func-base-uri;Returns the value of the base-uri property of the current or specified node
|
||||
fn:base-uri(node);2.0;https://www.w3.org/TR/xpath-functions/#func-base-uri;Returns the value of the base-uri property of the current or specified node
|
||||
fn:static-base-uri();2.0;https://www.w3.org/TR/xpath-functions/#func-static-base-uri;Returns the value of the base-uri
|
||||
fn:doc-available(URI);2.0;https://www.w3.org/TR/xpath-functions/#func-doc-available;Returns true if the doc() function returns a document node, otherwise it returns false
|
||||
fn:resolve-QName();2.0;https://www.w3.org/TR/xpath-functions/#func-resolve-QName;NONE
|
||||
fn:node-name(node);2.0;https://www.w3.org/TR/xpath-functions/#func-node-name;Returns the node-name of the argument node
|
||||
fn:default-collation();2.0;https://www.w3.org/TR/xpath-functions/#func-default-collation;Returns the value of the default collation
|
||||
fn:idref((string,string,...),node);2.0;https://www.w3.org/TR/xpath-functions/#func-idref;Returns a sequence of element or attribute nodes that have an IDREF value equal to the value of one or more of the values specified in the string argument
|
||||
fn:document-uri(node);2.0;https://www.w3.org/TR/xpath-functions/#func-document-uri;Returns the value of the document-uri property for the specified node
|
||||
fn:local-name-from-QName();2.0;https://www.w3.org/TR/xpath-functions/#func-local-name-from-QName;NONE
|
||||
fn:in-scope-prefixes();2.0;https://www.w3.org/TR/xpath-functions/#func-in-scope-prefixes;NONE
|
||||
fn:namespace-uri-for-prefix();2.0;https://www.w3.org/TR/xpath-functions/#func-namespace-uri-for-prefix;NONE
|
||||
fn:QName();2.0;https://www.w3.org/TR/xpath-functions/#func-QName;NONE
|
||||
fn:root() fn:root(node);2.0;https://www.w3.org/TR/xpath-functions/#func-root;Returns the root of the tree to which the current node or the specified belongs. This will usually be a document node
|
||||
fn:doc(URI);2.0;https://www.w3.org/TR/xpath-functions/#func-doc;NONE
|
||||
fn:resolve-uri(relative,base);2.0;https://www.w3.org/TR/xpath-functions/#func-resolve-uri;NONE
|
||||
fn:available-environment-variables();3.0;https://www.w3.org/TR/xpath-functions-30/#func-available-environment-variables;Returns a list of environment variable names
|
||||
fn:doc-available(uri);3.0;https://www.w3.org/TR/xpath-functions-30/#func-doc-available;The function returns true the function call fn:doc(uri) would return a document node
|
||||
fn:element-with-id();3.0;https://www.w3.org/TR/xpath-functions-31/#func-element-with-id;
|
||||
fn:encode-for-uri(uri-part);3.0;https://www.w3.org/TR/xpath-functions-30/#func-encode-for-uri;Encodes reserved characters in a string that is intended to be used in the path segment of a URI.
|
||||
fn:environment-variable(name);3.0;https://www.w3.org/TR/xpath-functions-30/#func-environment-variable;Returns the value of a system environment variable, if it exists
|
||||
fn:escape-html-uri(uri);3.0;https://www.w3.org/TR/xpath-functions-30/#func-escape-html-uri;Escapes a URI in the same way that HTML user agents handle attribute values expected to contain URIs
|
||||
fn:iri-to-uri(iri);3.0;https://www.w3.org/TR/xpath-functions-30/#func-iri-to-uri;Converts a string containing an IRI into a URI
|
||||
!Loop / Conditional;3.0
|
||||
fn:for-each(sequence*, function);3.0;https://www.w3.org/TR/xpath-functions-30/#func-for-each;Applies function item to every element in sequence
|
||||
fn:for-each-pair(sequence*, sequence*, function);3.0;https://www.w3.org/TR/xpath-functions-30/#func-for-each-pair;Applies the function to consecutive pairs of elements taken from sequences
|
||||
fn:fold-left(sequence*, baseValue, function);3.0;https://www.w3.org/TR/xpath-functions-30/#func-fold-left;Applies function item to every element in sequence, accumulating value
|
||||
fn:fold-right();3.0;https://www.w3.org/TR/xpath-functions-30/#func-fold-right;Applies function item to every element in sequence, accumulating value
|
||||
fn:filter(sequence*, function);3.0;https://www.w3.org/TR/xpath-functions-30/#func-filter;Returns those items from the sequence for which the supplied function returns true
|
||||
39
FunctionSet/XPath/10_examples
Normal file
39
FunctionSet/XPath/10_examples
Normal file
@@ -0,0 +1,39 @@
|
||||
!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
|
||||
109
FunctionSet/XPath/20
Normal file
109
FunctionSet/XPath/20
Normal file
@@ -0,0 +1,109 @@
|
||||
!Date / Time
|
||||
fn:adjust-date-to-timezone(date,timezone);2.0;https://www.w3.org/TR/xpath-functions/#func-adjust-date-to-timezone;If the timezone argument is empty, it returns a date without a timezone. Otherwise, it returns a date with a timezone
|
||||
fn:adjust-time-to-timezone(time,timezone);2.0;https://www.w3.org/TR/xpath-functions/#func-adjust-time-to-timezone;If the timezone argument is empty, it returns a time without a timezone. Otherwise, it returns a time with a timezone
|
||||
fn:implicit-timezone();2.0;https://www.w3.org/TR/xpath-functions/#func-implicit-timezone;Returns the value of the implicit timezone
|
||||
fn:dateTime(date,time);2.0;https://www.w3.org/TR/xpath-functions/#func-dateTime;Converts the arguments to a date and a time
|
||||
fn:current-time();2.0;https://www.w3.org/TR/xpath-functions/#func-current-time;Returns the current time (with timezone)
|
||||
fn:timezone-from-time(time);2.0;https://www.w3.org/TR/xpath-functions/#func-timezone-from-time;Returns the time zone component of the argument if any
|
||||
fn:hours-from-time(time);2.0;https://www.w3.org/TR/xpath-functions/#func-hours-from-time;Returns an integer that represents the hours component in the localized value of the argument
|
||||
fn:minutes-from-time(time);2.0;https://www.w3.org/TR/xpath-functions/#func-minutes-from-time;Returns an integer that represents the minutes component in the localized value of the argument
|
||||
fn:seconds-from-time(time);2.0;https://www.w3.org/TR/xpath-functions/#func-seconds-from-time;Returns an integer that represents the seconds component in the localized value of the argument
|
||||
fn:years-from-duration(datetimedur);2.0;https://www.w3.org/TR/xpath-functions/#func-years-from-duration;Returns an integer that represents the years component in the canonical lexical representation of the value of the argument
|
||||
fn:months-from-duration(datetimedur);2.0;https://www.w3.org/TR/xpath-functions/#func-years-from-duration;Returns an integer that represents the months component in the canonical lexical representation of the value of the argument
|
||||
fn:days-from-duration(datetimedur);2.0;https://www.w3.org/TR/xpath-functions/#func-;Returns an integer that represents the days component in the canonical lexical representation of the value of the argument
|
||||
fn:hours-from-duration(datetimedur);2.0;https://www.w3.org/TR/xpath-functions/#func-;Returns an integer that represents the hours component in the canonical lexical representation of the value of the argument
|
||||
fn:minutes-from-duration(datetimedur);2.0;https://www.w3.org/TR/xpath-functions/#func-;Returns an integer that represents the minutes component in the canonical lexical representation of the value of the argument
|
||||
fn:seconds-from-duration(datetimedur);2.0;https://www.w3.org/TR/xpath-functions/#func-;Returns a decimal that represents the seconds component in the canonical lexical representation of the value of the argument
|
||||
fn:current-date();2.0;https://www.w3.org/TR/xpath-functions/#func-current-date;Returns the current date (with timezone)
|
||||
fn:timezone-from-date(date);2.0;https://www.w3.org/TR/xpath-functions/#func-timezone-from-date;Returns the time zone component of the argument if any
|
||||
fn:year-from-date(date);2.0;https://www.w3.org/TR/xpath-functions/#func-year-from-date;Returns an integer that represents the year in the localized value of the argument
|
||||
fn:month-from-date(date);2.0;https://www.w3.org/TR/xpath-functions/#func-month-from-date;Returns an integer that represents the month in the localized value of the argument
|
||||
fn:day-from-date(date);2.0;https://www.w3.org/TR/xpath-functions/#func-day-from-date;Returns an integer that represents the day in the localized value of the argument
|
||||
fn:current-dateTime();2.0;https://www.w3.org/TR/xpath-functions/#func-current-dateTime;Returns the current dateTime (with timezone)
|
||||
fn:timezone-from-dateTime(datetime);2.0;https://www.w3.org/TR/xpath-functions/#func-timezone-from-dateTime;Returns the time zone component of the argument if any
|
||||
fn:year-from-dateTime(datetime);2.0;https://www.w3.org/TR/xpath-functions/#func-year-from-dateTime;Returns an integer that represents the year component in the localized value of the argument
|
||||
fn:month-from-dateTime(datetime);2.0;https://www.w3.org/TR/xpath-functions/#func-month-from-dateTime;Returns an integer that represents the month component in the localized value of the argument
|
||||
fn:day-from-dateTime(datetime);2.0;https://www.w3.org/TR/xpath-functions/#func-day-from-dateTime;Returns an integer that represents the day component in the localized value of the argument
|
||||
fn:hours-from-dateTime(datetime);2.0;https://www.w3.org/TR/xpath-functions/#func-hours-from-dateTime;Returns an integer that represents the hours component in the localized value of the argument
|
||||
fn:minutes-from-dateTime(datetime);2.0;https://www.w3.org/TR/xpath-functions/#func-minutes-from-dateTime;Returns an integer that represents the minutes component in the localized value of the argument
|
||||
fn:seconds-from-dateTime(datetime);2.0;https://www.w3.org/TR/xpath-functions/#func-seconds-from-dateTime;Returns a decimal that represents the seconds component in the localized value of the argument
|
||||
fn:adjust-dateTime-to-timezone(datetime,timezone);2.0;https://www.w3.org/TR/xpath-functions/#func-adjust-dateTime-to-timezone;If the timezone argument is empty, it returns a dateTime without a timezone. Otherwise, it returns a dateTime with a timezone
|
||||
|
||||
|
||||
!Collections
|
||||
fn:avg((arg,arg,...));2.0;https://www.w3.org/TR/xpath-functions/#func-avg;Returns the average of the argument values
|
||||
fn:exactly-one(item,item,...);2.0;https://www.w3.org/TR/xpath-functions/#func-exactly-one;Returns the argument if it contains exactly one item, otherwise it raises an error
|
||||
fn:zero-or-one(item,item,...);2.0;https://www.w3.org/TR/xpath-functions/#func-zero-or-one;Returns the argument if it contains zero or one items, otherwise it raises an error
|
||||
fn:index-of((item,item,...),searchitem);2.0;https://www.w3.org/TR/xpath-functions/#func-index-of;Returns the positions within the sequence of items that are equal to the searchitem argument
|
||||
fn:reverse((item,item,...));2.0;https://www.w3.org/TR/xpath-functions/#func-reverse;Returns the reversed order of the items specified
|
||||
fn:one-or-more(item,item,...);2.0;https://www.w3.org/TR/xpath-functions/#func-one-or-more;Returns the argument if it contains one or more items, otherwise it raises an error
|
||||
fn:distinct-values((item,item,...),collation);2.0;https://www.w3.org/TR/xpath-functions/#func-distinct-values;Returns only distinct (different) values
|
||||
fn:exists(item,item,...);2.0;https://www.w3.org/TR/xpath-functions/#func-exists;Returns true if the value of the arguments IS NOT an empty sequence, otherwise it returns false
|
||||
fn:subsequence((item,item,...),start,len);2.0;https://www.w3.org/TR/xpath-functions/#func-subsequence;Returns a sequence of items from the position specified by the start argument and continuing for the number of items specified by the len argument. The first item is located at position 1
|
||||
fn:empty(item,item,...);2.0;https://www.w3.org/TR/xpath-functions/#func-empty;Returns true if the value of the arguments IS an empty sequence, otherwise it returns false
|
||||
fn:insert-before((item,item,...),pos,inserts);2.0;https://www.w3.org/TR/xpath-functions/#func-insert-before;Returns a new sequence constructed from the value of the item arguments
|
||||
fn:remove((item,item,...),position);2.0;https://www.w3.org/TR/xpath-functions/#func-remove;Returns a new sequence constructed from the value of the item arguments
|
||||
fn:unordered((item,item,...));2.0;https://www.w3.org/TR/xpath-functions/#func-unordered;Returns the items in an implementation dependent order
|
||||
fn:data(item.item,...);2.0;https://www.w3.org/TR/xpath-functions/#func-data;Takes a sequence of items and returns a sequence of atomic values
|
||||
fn:collection();2.0;https://www.w3.org/TR/xpath-functions/#func-collection;NONE
|
||||
fn:collection(string);2.0;https://www.w3.org/TR/xpath-functions/#func-collection;NONE
|
||||
fn:min((arg,arg,...));2.0;https://www.w3.org/TR/xpath-functions/#func-min;Returns the argument that is less than the others
|
||||
fn:max((arg,arg,...));2.0;https://www.w3.org/TR/xpath-functions/#func-max;Returns the argument that is greater than the others
|
||||
fn:deep-equal(param1,param2,collation);2.0;https://www.w3.org/TR/xpath-functions/#func-deep-equal;Returns true if param1 and param2 are deep-equal to each other, otherwise it returns false
|
||||
|
||||
|
||||
!anyURI
|
||||
|
||||
|
||||
!String
|
||||
fn:string-join((string,string,...),sep);2.0;https://www.w3.org/TR/xpath-functions/#func-string-join;Returns a string created by concatenating the string arguments and using the sep argument as the separator
|
||||
fn:string-to-codepoints(string);2.0;https://www.w3.org/TR/xpath-functions/#func-string-to-codepoints;Returns the sequence of the Unicode standard code points from a string
|
||||
fn:compare(comp1,comp2);2.0;https://www.w3.org/TR/xpath-functions/#func-compare;Returns -1 if comp1 is less than comp2, 0 if comp1 is equal to comp2, or 1 if comp1 is greater than comp2 (according to the rules of the collation that is used)
|
||||
fn:compare(comp1,comp2,collation);2.0;https://www.w3.org/TR/xpath-functions/#func-compare;Returns -1 if comp1 is less than comp2, 0 if comp1 is equal to comp2, or 1 if comp1 is greater than comp2 (according to the rules of the collation that is used)
|
||||
fn:codepoints-to-string((int,int,...));2.0;https://www.w3.org/TR/xpath-functions/#func-codepoints-to-string;Creates a string from a sequence of the Unicode Standard code points
|
||||
fn:codepoint-equal(comp1,comp2);2.0;https://www.w3.org/TR/xpath-functions/#func-codepoint-equal;Returns true if the value of comp1 is equal to the value of comp2, according to the Unicode code point collation (http://www.w3.org/2005/02/xpath-functions/collation/codepoint), otherwise it returns false
|
||||
fn:normalize-unicode();2.0;https://www.w3.org/TR/xpath-functions/#func-normalize-unicode;NONE
|
||||
fn:upper-case(string);2.0;https://www.w3.org/TR/xpath-functions/#func-upper-case;Converts the string argument to upper-case
|
||||
fn:lower-case(string);2.0;https://www.w3.org/TR/xpath-functions/#func-lower-case;Converts the string argument to lower-case
|
||||
fn:escape-uri(stringURI,esc-res);2.0;https://www.w3.org/TR/xpath-functions/#func-escape-uri;
|
||||
fn:tokenize(string,pattern);2.0;https://www.w3.org/TR/xpath-functions/#func-tokenize;
|
||||
fn:matches(string,pattern);2.0;https://www.w3.org/TR/xpath-functions/#func-matches;Returns true if the string argument matches the pattern, otherwise, it returns false
|
||||
fn:replace(string,pattern,replace);2.0;https://www.w3.org/TR/xpath-functions/#func-replace;Returns a string that is created by replacing the given pattern with the replace argument
|
||||
fn:ends-with(string1,string2);2.0;https://www.w3.org/TR/xpath-functions/#func-ends-with;Returns true if string1 ends with string2, otherwise it returns false
|
||||
|
||||
|
||||
!STH
|
||||
|
||||
|
||||
!Number
|
||||
fn:round-half-to-even();2.0;https://www.w3.org/TR/xpath-functions/#func-round-half-to-even;
|
||||
fn:abs(num);2.0;https://www.w3.org/TR/xpath-functions/#func-abs;Returns the absolute value of the argument
|
||||
|
||||
|
||||
!Error
|
||||
fn:error()
|
||||
fn:error(error)
|
||||
fn:error(error,description)
|
||||
fn:error(error,description,error-object);2.0;https://www.w3.org/TR/xpath-functions/#func-error;
|
||||
fn:trace(value,label);2.0;https://www.w3.org/TR/xpath-functions/#func-trace;Used to debug queries
|
||||
|
||||
|
||||
!STH2
|
||||
fn:nilled(node);2.0;https://www.w3.org/TR/xpath-functions/#func-nilled;Returns a Boolean value indicating whether the argument node is nilled
|
||||
fn:namespace-uri-from-QName();2.0;https://www.w3.org/TR/xpath-functions/#func-namespace-uri-from-QName;NONE
|
||||
fn:base-uri();2.0;https://www.w3.org/TR/xpath-functions/#func-base-uri;Returns the value of the base-uri property of the current or specified node
|
||||
fn:base-uri(node);2.0;https://www.w3.org/TR/xpath-functions/#func-base-uri;Returns the value of the base-uri property of the current or specified node
|
||||
fn:static-base-uri();2.0;https://www.w3.org/TR/xpath-functions/#func-static-base-uri;Returns the value of the base-uri
|
||||
fn:doc-available(URI);2.0;https://www.w3.org/TR/xpath-functions/#func-doc-available;Returns true if the doc() function returns a document node, otherwise it returns false
|
||||
fn:resolve-QName();2.0;https://www.w3.org/TR/xpath-functions/#func-resolve-QName;NONE
|
||||
fn:node-name(node);2.0;https://www.w3.org/TR/xpath-functions/#func-node-name;Returns the node-name of the argument node
|
||||
fn:default-collation();2.0;https://www.w3.org/TR/xpath-functions/#func-default-collation;Returns the value of the default collation
|
||||
fn:idref((string,string,...),node);2.0;https://www.w3.org/TR/xpath-functions/#func-idref;Returns a sequence of element or attribute nodes that have an IDREF value equal to the value of one or more of the values specified in the string argument
|
||||
fn:document-uri(node);2.0;https://www.w3.org/TR/xpath-functions/#func-document-uri;Returns the value of the document-uri property for the specified node
|
||||
fn:local-name-from-QName();2.0;https://www.w3.org/TR/xpath-functions/#func-local-name-from-QName;NONE
|
||||
fn:in-scope-prefixes();2.0;https://www.w3.org/TR/xpath-functions/#func-in-scope-prefixes;NONE
|
||||
fn:namespace-uri-for-prefix();2.0;https://www.w3.org/TR/xpath-functions/#func-namespace-uri-for-prefix;NONE
|
||||
fn:QName();2.0;https://www.w3.org/TR/xpath-functions/#func-QName;NONE
|
||||
fn:root() fn:root(node);2.0;https://www.w3.org/TR/xpath-functions/#func-root;Returns the root of the tree to which the current node or the specified belongs. This will usually be a document node
|
||||
fn:doc(URI);2.0;https://www.w3.org/TR/xpath-functions/#func-doc;NONE
|
||||
fn:resolve-uri(relative,base);2.0;https://www.w3.org/TR/xpath-functions/#func-resolve-uri;NONE
|
||||
74
FunctionSet/XPath/20_examples
Normal file
74
FunctionSet/XPath/20_examples
Normal file
@@ -0,0 +1,74 @@
|
||||
!DATE/TIMES
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
!anyURI
|
||||
fn:resolve-uri(relative,base);NONE
|
||||
!Number
|
||||
|
||||
!String
|
||||
|
||||
|
||||
fn:normalize-unicode();NONE
|
||||
|
||||
fn:escape-uri(stringURI,esc-res);;escape-uri("http://example.com/test#car", true())?"http%3A%2F%2Fexample.com%2Ftest#car"?escape-uri("http://example.com/test#car", false())?"http://example.com/test#car"?escape-uri ("http://example.com/~bébé", false())?"http://example.com/~b%C3%A9b%C3%A9"
|
||||
!STH
|
||||
|
||||
|
||||
fn:nilled(node);Returns a Boolean value indicating whether the argument node is nilled
|
||||
|
||||
fn:index-of((item,item,...),searchitem);;index-of((15, 40, 25, 40, 10), 40)?(2, 4)?index-of(("a", "dog", "and", "a", "duck"), "a") Result (1, 4)?index-of((15, 40, 25, 40, 10), 18)?()
|
||||
fn:collection();NONE
|
||||
fn:collection(string);NONE
|
||||
fn:resolve-QName();NONE
|
||||
|
||||
fn:deep-equal(param1,param2,collation);Returns true if param1 and param2 are deep-equal to each other, otherwise it returns false
|
||||
|
||||
fn:zero-or-one(item,item,...);Returns the argument if it contains zero or one items, otherwise it raises an error
|
||||
fn:idref((string,string,...),node);Returns a sequence of element or attribute nodes that have an IDREF value equal to the value of one or more of the values specified in the string argument
|
||||
|
||||
|
||||
fn:replace(string,pattern,replace);;replace("Bella Italia", "l", "*")?'Be**a Ita*ia'?replace("Bella Italia", "l", "")?'Bea Itaia'
|
||||
|
||||
|
||||
|
||||
!STH2
|
||||
fn:namespace-uri-from-QName();NONE
|
||||
|
||||
fn:base-uri();Returns the value of the base-uri property of the current or specified node
|
||||
fn:base-uri(node);Returns the value of the base-uri property of the current or specified node
|
||||
fn:error()
|
||||
fn:error(error)
|
||||
fn:error(error,description)
|
||||
fn:error(error,description,error-object);;error(fn:QName('http://example.com/test', 'err:toohigh'), 'Error: Price is too high')?http://example.com/test#toohigh and the string "Error: Price is too high" to the external processing environment
|
||||
fn:doc-available(URI);Returns true if the doc() function returns a document node, otherwise it returns false
|
||||
fn:subsequence((item,item,...),start,len);Returns a sequence of items from the position specified by the start argument and continuing for the number of items specified by the len argument. The first item is located at position 1?subsequence(($item1, $item2, $item3,...), 3)?($item3, ...)?subsequence(($item1, $item2, $item3, ...), 2, 2)?($item2, $item3)
|
||||
fn:trace(value,label);Used to debug queries
|
||||
fn:local-name-from-QName();NONE
|
||||
fn:in-scope-prefixes();NONE
|
||||
fn:namespace-uri-for-prefix();NONE
|
||||
|
||||
fn:unordered((item,item,...));Returns the items in an implementation dependent order
|
||||
fn:QName();NONE
|
||||
fn:root() fn:root(node);Returns the root of the tree to which the current node or the specified belongs. This will usually be a document node
|
||||
|
||||
fn:remove((item,item,...),position);Returns a new sequence constructed from the value of the item arguments
|
||||
fn:ends-with(string1,string2);Returns true if string1 ends with string2, otherwise it returns false?ends-with('XML','X')?false
|
||||
fn:doc(URI);NONE
|
||||
82
FunctionSet/XPath/20_examples_done
Normal file
82
FunctionSet/XPath/20_examples_done
Normal file
@@ -0,0 +1,82 @@
|
||||
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);
|
||||
|
||||
223
FunctionSet/XPath/30
Normal file
223
FunctionSet/XPath/30
Normal file
@@ -0,0 +1,223 @@
|
||||
fn:abs
|
||||
fn:acos
|
||||
fn:add-dayTimeDurations
|
||||
fn:add-dayTimeDuration-to-date
|
||||
fn:add-dayTimeDuration-to-dateTime
|
||||
fn:add-dayTimeDuration-to-time
|
||||
fn:add-yearMonthDurations
|
||||
fn:add-yearMonthDuration-to-date
|
||||
fn:add-yearMonthDuration-to-dateTime
|
||||
fn:adjust-dateTime-to-timezone
|
||||
fn:adjust-date-to-timezone
|
||||
fn:adjust-time-to-timezone
|
||||
fn:analyze-string
|
||||
fn:asin
|
||||
fn:atan
|
||||
fn:atan2
|
||||
fn:available-environment-variables
|
||||
fn:avg
|
||||
fn:base64Binary-equal
|
||||
fn:base-uri
|
||||
fn:boolean
|
||||
fn:boolean-equal
|
||||
fn:boolean-greater-than
|
||||
fn:boolean-less-than
|
||||
fn:ceiling
|
||||
fn:codepoint-equal
|
||||
fn:codepoints-to-string
|
||||
fn:collection
|
||||
fn:compare
|
||||
fn:concat
|
||||
fn:concatenate
|
||||
fn:contains
|
||||
fn:cos
|
||||
fn:count
|
||||
fn:current-date
|
||||
fn:current-dateTime
|
||||
fn:current-time
|
||||
fn:data
|
||||
fn:date-equal
|
||||
fn:date-greater-than
|
||||
fn:date-less-than
|
||||
fn:dateTime
|
||||
fn:dateTime-equal
|
||||
fn:dateTime-greater-than
|
||||
fn:dateTime-less-than
|
||||
fn:day-from-date
|
||||
fn:day-from-dateTime
|
||||
fn:days-from-duration
|
||||
fn:dayTimeDuration-greater-than
|
||||
fn:dayTimeDuration-less-than
|
||||
fn:deep-equal
|
||||
fn:default-collation
|
||||
fn:distinct-values
|
||||
fn:divide-dayTimeDuration
|
||||
fn:divide-dayTimeDuration-by-dayTimeDuration
|
||||
fn:divide-yearMonthDuration
|
||||
fn:divide-yearMonthDuration-by-yearMonthDuration
|
||||
fn:doc
|
||||
fn:doc-available
|
||||
fn:document-uri
|
||||
fn:duration-equal
|
||||
fn:element-with-id
|
||||
fn:empty
|
||||
fn:encode-for-uri
|
||||
fn:ends-with
|
||||
fn:environment-variable
|
||||
fn:error
|
||||
fn:escape-html-uri
|
||||
fn:exactly-one
|
||||
fn:except
|
||||
fn:exists
|
||||
fn:exp
|
||||
fn:exp10
|
||||
fn:falsefilter
|
||||
fn:floor
|
||||
fn:fold-left
|
||||
fn:fold-right
|
||||
fn:for-each
|
||||
fn:for-each-pair
|
||||
fn:format-date
|
||||
fn:format-dateTime
|
||||
fn:format-integer
|
||||
fn:format-number
|
||||
fn:format-time
|
||||
fn:function-arity
|
||||
fn:function-lookup
|
||||
fn:function-name
|
||||
fn:gDay-equal
|
||||
fn:generate-id
|
||||
fn:gMonthDay-equal
|
||||
fn:gMonth-equal
|
||||
fn:gYear-equal
|
||||
fn:gYearMonth-equal
|
||||
fn:has-children
|
||||
fn:head
|
||||
fn:hexBinary-equal
|
||||
fn:hours-from-dateTime
|
||||
fn:hours-from-duration
|
||||
fn:hours-from-time
|
||||
fn:id
|
||||
fn:idref
|
||||
fn:implicit-timezone
|
||||
fn:index-of
|
||||
fn:innermost
|
||||
fn:in-scope-prefixes
|
||||
fn:insert-before
|
||||
fn:intersect
|
||||
fn:iri-to-uri
|
||||
fn:is-same-node
|
||||
fn:lang
|
||||
fn:last
|
||||
fn:local-name
|
||||
fn:local-name-from-QName
|
||||
fn:log
|
||||
fn:log10
|
||||
fn:lower-case
|
||||
fn:matches
|
||||
fn:max
|
||||
fn:min
|
||||
fn:minutes-from-dateTime
|
||||
fn:minutes-from-duration
|
||||
fn:minutes-from-time
|
||||
fn:month-from-date
|
||||
fn:month-from-dateTime
|
||||
fn:months-from-duration
|
||||
fn:multiply-dayTimeDuration
|
||||
fn:multiply-yearMonthDuration
|
||||
fn:name
|
||||
fn:namespace-uri
|
||||
fn:namespace-uri-for-prefix
|
||||
fn:namespace-uri-from-QName
|
||||
fn:nilled
|
||||
fn:node-after
|
||||
fn:node-before
|
||||
fn:node-name
|
||||
fn:normalize-space
|
||||
fn:normalize-unicode
|
||||
fn:not
|
||||
fn:NOTATION-equal
|
||||
fn:number
|
||||
fn:numeric-add
|
||||
fn:numeric-divide
|
||||
fn:numeric-equal
|
||||
fn:numeric-greater-than
|
||||
fn:numeric-integer-divide
|
||||
fn:numeric-less-than
|
||||
fn:numeric-mod
|
||||
fn:numeric-multiply
|
||||
fn:numeric-subtract
|
||||
fn:numeric-unary-minus
|
||||
fn:numeric-unary-plus
|
||||
fn:one-or-more
|
||||
fn:outermost
|
||||
fn:parse-xml
|
||||
fn:parse-xml-fragment
|
||||
fn:path
|
||||
fn:pi
|
||||
fn:position
|
||||
fn:pow
|
||||
fn:prefix-from-QName
|
||||
fn:QName
|
||||
fn:QName-equal
|
||||
fn:remove
|
||||
fn:replace
|
||||
fn:resolve-QName
|
||||
fn:resolve-uri
|
||||
fn:reverse
|
||||
fn:root
|
||||
fn:round
|
||||
fn:round-half-to-even
|
||||
fn:seconds-from-dateTime
|
||||
fn:seconds-from-duration
|
||||
fn:seconds-from-time
|
||||
fn:serialize
|
||||
fn:sin
|
||||
fn:sqrt
|
||||
fn:starts-with
|
||||
fn:static-base-uri
|
||||
fn:string
|
||||
fn:string-join
|
||||
fn:string-length
|
||||
fn:string-to-codepoints
|
||||
fn:subsequence
|
||||
fn:substring
|
||||
fn:substring-after
|
||||
fn:substring-before
|
||||
fn:subtract-dates
|
||||
fn:subtract-dateTimes
|
||||
fn:subtract-dayTimeDuration-from-date
|
||||
fn:subtract-dayTimeDuration-from-dateTime
|
||||
fn:subtract-dayTimeDuration-from-time
|
||||
fn:subtract-dayTimeDurations
|
||||
fn:subtract-times
|
||||
fn:subtract-yearMonthDuration-from-date
|
||||
fn:subtract-yearMonthDuration-from-dateTime
|
||||
fn:subtract-yearMonthDurations
|
||||
fn:sum
|
||||
fn:tail
|
||||
fn:tan
|
||||
fn:time-equal
|
||||
fn:time-greater-than
|
||||
fn:time-less-than
|
||||
fn:timezone-from-date
|
||||
fn:timezone-from-dateTime
|
||||
fn:timezone-from-time
|
||||
fn:to
|
||||
fn:tokenize
|
||||
fn:trace
|
||||
fn:translate
|
||||
fn:true
|
||||
fn:union
|
||||
fn:unordered
|
||||
fn:unparsed-text
|
||||
fn:unparsed-text-available
|
||||
fn:unparsed-text-lines
|
||||
fn:upper-case
|
||||
fn:uri-collection
|
||||
fn:year-from-date
|
||||
fn:year-from-dateTime
|
||||
fn:yearMonthDuration-greater-than
|
||||
fn:yearMonthDuration-less-than
|
||||
fn:years-from-duration
|
||||
fn:zero-or-one
|
||||
134
FunctionSet/XPath/30_unique
Normal file
134
FunctionSet/XPath/30_unique
Normal file
@@ -0,0 +1,134 @@
|
||||
!Math
|
||||
math:acos(double);3.0;https://www.w3.org/TR/xpath-functions-30/#func-math-acos;Returns the arc cosine of the argument
|
||||
math:asin(double);3.0;https://www.w3.org/TR/xpath-functions-30/#func-math-asin;Returns the arc sine of the argument
|
||||
math:atan(double);3.0;https://www.w3.org/TR/xpath-functions-30/#func-math-atan;Returns the arc tangent of the argument
|
||||
math:atan2(double, double);3.0;https://www.w3.org/TR/xpath-functions-30/#func-math-atan2;Returns the angle in radians subtended at the origin by the point on a plane with coordinates (x, y) and the positive x-axis
|
||||
math:cos(double);3.0;https://www.w3.org/TR/xpath-functions-30/#func-math-cos;Returns the cosine of the argument
|
||||
math:exp(double);3.0;https://www.w3.org/TR/xpath-functions-30/#func-math-exp;Returns the value of e^x
|
||||
math:exp10(double);3.0;https://www.w3.org/TR/xpath-functions-30/#func-math-exp10;Returns the value of 10^x
|
||||
math:log(double);3.0;https://www.w3.org/TR/xpath-functions-30/#func-math-log;Returns thenatural logarithm of the argument
|
||||
math:log10(double);3.0;https://www.w3.org/TR/xpath-functions-30/#func-math-log10;Returns the base-ten logarithm of the argument
|
||||
math:pi();3.0;https://www.w3.org/TR/xpath-functions-30/#func-math-pi;Returns an approximation to the mathematical constant π
|
||||
math:pow(double, double);3.0;https://www.w3.org/TR/xpath-functions-30/#func-math-pow;Returns the result of raising the first argument to the power of the second
|
||||
math:sin(double);3.0;https://www.w3.org/TR/xpath-functions-30/#func-math-sin;Returns the sine of the argument
|
||||
math:sqrt(double);3.0;https://www.w3.org/TR/xpath-functions-30/#func-math-sqrt;Returns the non-negative square root of the argument
|
||||
math:tan(double);3.0;https://www.w3.org/TR/xpath-functions-30/#func-math-tan;Returns the tangent of the argument
|
||||
|
||||
|
||||
!Loop / Conditional
|
||||
fn:for-each(sequence*, function);3.0;https://www.w3.org/TR/xpath-functions-30/#func-for-each;Applies function item to every element in sequence
|
||||
fn:for-each-pair(sequence*, sequence*, function);3.0;https://www.w3.org/TR/xpath-functions-30/#func-for-each-pair;Applies the function to consecutive pairs of elements taken from sequences
|
||||
fn:fold-left(sequence*, baseValue, function);3.0;https://www.w3.org/TR/xpath-functions-30/#func-fold-left;Applies function item to every element in sequence, accumulating value
|
||||
fn:fold-right();3.0;https://www.w3.org/TR/xpath-functions-30/#func-fold-right;Applies function item to every element in sequence, accumulating value
|
||||
fn:filter(sequence*, function);3.0;https://www.w3.org/TR/xpath-functions-30/#func-filter;Returns those items from the sequence for which the supplied function returns true
|
||||
|
||||
fn:analyze-string(input, pattern);3.0;https://www.w3.org/TR/xpath-functions-30/#func-analyze-string;Analyzes string using regex, returns XML indicating parts that matched and failed to match
|
||||
fn:available-environment-variables();3.0;https://www.w3.org/TR/xpath-functions-30/#func-available-environment-variables;Returns a list of environment variable names
|
||||
|
||||
fn:doc-available(uri);3.0;https://www.w3.org/TR/xpath-functions-30/#func-doc-available;The function returns true the function call fn:doc($uri) would return a document node
|
||||
fn:element-with-id();3.0;;
|
||||
fn:encode-for-uri(uri-part);3.0;https://www.w3.org/TR/xpath-functions-30/#func-encode-for-uri;Encodes reserved characters in a string that is intended to be used in the path segment of a URI.
|
||||
fn:environment-variable(name);3.0;https://www.w3.org/TR/xpath-functions-30/#func-environment-variable;Returns the value of a system environment variable, if it exists
|
||||
fn:escape-html-uri(uri);3.0;https://www.w3.org/TR/xpath-functions-30/#func-escape-html-uri;Escapes a URI in the same way that HTML user agents handle attribute values expected to contain URIs
|
||||
|
||||
fn:format-date(value, pattern);3.0;https://www.w3.org/TR/xpath-functions-30/#func-format-date;Returns a string formatted using provided pattern
|
||||
fn:format-dateTime(value, pattern);3.0;https://www.w3.org/TR/xpath-functions-30/#func-format-dateTime;Returns a string containing using provided pattern
|
||||
fn:format-integer(value, pattern);3.0;https://www.w3.org/TR/xpath-functions-30/#func-format-integer;Returns a string formatted using provided pattern
|
||||
fn:format-number(value, pattern);3.0;https://www.w3.org/TR/xpath-functions-30/#func-format-number;Returns a string formatted using provided pattern
|
||||
fn:format-time(value, pattern);3.0;https://www.w3.org/TR/xpath-functions-30/#func-format-time;Returns a string formatted using provided pattern
|
||||
fn:function-arity(function);3.0;https://www.w3.org/TR/xpath-functions-30/#func-function-arity;Returns the number of arguments of provided function
|
||||
fn:function-lookup(name, arity);3.0;https://www.w3.org/TR/xpath-functions-30/#func-function-lookup;Returns the function having a given name and arity, if there is one.
|
||||
fn:function-name();3.0;https://www.w3.org/TR/xpath-functions-30/#func-function-name;Returns the name of the function identified by a function item
|
||||
|
||||
fn:has-children();3.0;https://www.w3.org/TR/xpath-functions-30/#func-has-children;Returns true if the supplied node has one or more child nodes
|
||||
fn:head();3.0;https://www.w3.org/TR/xpath-functions-30/#func-head;Returns the first item in a sequence
|
||||
fn:innermost();3.0;https://www.w3.org/TR/xpath-functions-30/#func-innermost;Retruns the collection with parrents (if any) of contained elements removed
|
||||
|
||||
fn:iri-to-uri(iri);3.0;https://www.w3.org/TR/xpath-functions-30/#func-iri-to-uri;Converts a string containing an IRI into a URI
|
||||
|
||||
|
||||
fn:NOTATION-equal();3.0;;
|
||||
fn:parse-xml(string);3.0;https://www.w3.org/TR/xpath-functions-30/#func-parse-xml;Converts xml from string to document node
|
||||
fn:parse-xml-fragment(string);3.0;https://www.w3.org/TR/xpath-functions-30/#func-parse-xml-fragment;Converts xml fragment from string to document node
|
||||
fn:path();3.0;https://www.w3.org/TR/xpath-functions-30/#func-path;Returns node path relative to its root
|
||||
fn:prefix-from-QName(QName);3.0;https://www.w3.org/TR/xpath-functions-30/#func-prefix-from-QName;Returns the prefix component of the supplied QName
|
||||
fn:QName-equal(QName1, QName2);3.0;https://www.w3.org/TR/xpath-functions-30/#func-QName-equal;Returns true if two supplied QNames are equal (namespace URI and local part)
|
||||
fn:serialize(item);3.0;https://www.w3.org/TR/xpath-functions-30/#func-serialize;Returns serialized representation
|
||||
fn:tail(sequence);3.0;https://www.w3.org/TR/xpath-functions-30/#func-tail;Returns all but the first item in a sequence
|
||||
fn:tokenize(input, separator);3.0;https://www.w3.org/TR/xpath-functions-30/#func-tokenize;Splits string wherever a separator is found
|
||||
|
||||
fn:unparsed-text(uri);3.0;https://www.w3.org/TR/xpath-functions-30/#func-unparsed-text;Returns text representation of external resource
|
||||
fn:unparsed-text-available(uri);3.0;https://www.w3.org/TR/xpath-functions-30/#func-unparsed-text-available;Checks if unparsed-text call would succeed
|
||||
fn:unparsed-text-lines(uri);3.0;https://www.w3.org/TR/xpath-functions-30/#func-unparsed-text-lines;Returns strings, one for each line of file
|
||||
fn:uri-collection();3.0;https://www.w3.org/TR/xpath-functions-30/#func-uri-collection;Returns a sequence of xs:anyURI values representing the URIs in a resource collection
|
||||
|
||||
|
||||
!Operators
|
||||
op:base64Binary-equal();3.0;;
|
||||
op:add-dayTimeDurations(dayTimeDuration, dayTimeDuration);3.0;Returns the sum of two dayTimeDuration values;
|
||||
op:add-dayTimeDuration-to-date(dayTimeDuration, date);3.0;Moves given date by given duration;
|
||||
op:add-dayTimeDuration-to-dateTime(dayTimeDuration, dateTime);3.0;Moves given dateTime by given duration;
|
||||
op:add-dayTimeDuration-to-time(dayTimeDuration, time);3.0;Moves given time by given duration;
|
||||
op:add-yearMonthDurations(yearMonthDuration, yearMonthDuration);3.0;Returns the sum of two yearMonthDuration values;
|
||||
op:add-yearMonthDuration-to-date(yearMonthDuration, date);3.0;Moves given date by given duration;
|
||||
op:add-yearMonthDuration-to-dateTime(yearMonthDuration, dateTime);3.0;Moves given dateTime by given duration;
|
||||
op:substring-before();3.0;;
|
||||
op:subtract-dates();3.0;;
|
||||
op:subtract-dateTimes();3.0;;
|
||||
op:subtract-dayTimeDuration-from-date();3.0;;
|
||||
op:subtract-dayTimeDuration-from-dateTime();3.0;;
|
||||
op:subtract-dayTimeDuration-from-time();3.0;;
|
||||
op:subtract-dayTimeDurations();3.0;;
|
||||
op:subtract-times();3.0;;
|
||||
op:subtract-yearMonthDuration-from-date();3.0;;
|
||||
op:subtract-yearMonthDuration-from-dateTime();3.0;;
|
||||
op:subtract-yearMonthDurations();3.0;;
|
||||
op:date-equal();3.0;;
|
||||
op:date-greater-than();3.0;;
|
||||
op:date-less-than();3.0;;
|
||||
op:dateTime-equal();3.0;;
|
||||
op:dateTime-greater-than();3.0;;
|
||||
op:dateTime-less-than();3.0;;
|
||||
op:dayTimeDuration-greater-than();3.0;;
|
||||
op:dayTimeDuration-less-than();3.0;;
|
||||
op:divide-dayTimeDuration();3.0;;
|
||||
op:divide-dayTimeDuration-by-dayTimeDuration();3.0;;
|
||||
op:divide-yearMonthDuration();3.0;;
|
||||
op:divide-yearMonthDuration-by-yearMonthDuration();3.0;;
|
||||
op:boolean-equal();3.0;;
|
||||
op:boolean-greater-than();3.0;;
|
||||
op:boolean-less-than();3.0;;
|
||||
op:concatenate();3.0;;
|
||||
op:multiply-dayTimeDuration();3.0;;
|
||||
op:multiply-yearMonthDuration();3.0;;
|
||||
op:time-equal();3.0;;
|
||||
op:time-greater-than();3.0;;
|
||||
op:time-less-than();3.0;;
|
||||
op:numeric-add();3.0;;
|
||||
op:numeric-divide();3.0;;
|
||||
op:numeric-equal();3.0;;
|
||||
op:numeric-greater-than();3.0;;
|
||||
op:numeric-integer-divide();3.0;;
|
||||
op:numeric-less-than();3.0;;
|
||||
op:numeric-mod();3.0;;
|
||||
op:numeric-multiply();3.0;;
|
||||
op:numeric-subtract();3.0;;
|
||||
op:numeric-unary-minus();3.0;;
|
||||
op:numeric-unary-plus();3.0;;
|
||||
op:outermost();3.0;;
|
||||
op:yearMonthDuration-greater-than();3.0;;
|
||||
op:yearMonthDuration-less-than();3.0;;
|
||||
op:gDay-equal();3.0;;
|
||||
op:generate-id();3.0;;
|
||||
op:gMonthDay-equal();3.0;;
|
||||
op:gMonth-equal();3.0;;
|
||||
op:gYear-equal();3.0;;
|
||||
op:gYearMonth-equal();3.0;;
|
||||
op:duration-equal();3.0;;
|
||||
op:intersect();3.0;;
|
||||
op:union();3.0;;
|
||||
op:except();3.0;;
|
||||
op:node-after();3.0;;
|
||||
op:node-before();3.0;;
|
||||
op:is-same-node();3.0;;
|
||||
op:hexBinary-equal();3.0;;
|
||||
62
FunctionSet/XPath/30_unique_examples
Normal file
62
FunctionSet/XPath/30_unique_examples
Normal file
@@ -0,0 +1,62 @@
|
||||
!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);https://www.w3.org/TR/xpath-functions-30/#func-escape-html-uri;Escapes a URI in the same way that HTML user agents handle attribute values expected to contain URIs
|
||||
|
||||
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);https://www.w3.org/TR/xpath-functions-30/#func-function-lookup;Returns the function having a given name and arity, if there is one.
|
||||
fn:function-name();https://www.w3.org/TR/xpath-functions-30/#func-function-name;Returns the name of the function identified by a function item
|
||||
|
||||
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);https://www.w3.org/TR/xpath-functions-30/#func-iri-to-uri;Converts a string containing an IRI into a URI
|
||||
|
||||
|
||||
fn:NOTATION-equal();;
|
||||
fn:parse-xml(string);https://www.w3.org/TR/xpath-functions-30/#func-parse-xml;Converts xml from string to document node
|
||||
fn:parse-xml-fragment(string);https://www.w3.org/TR/xpath-functions-30/#func-parse-xml-fragment;Converts xml fragment from string to document node
|
||||
fn:path();https://www.w3.org/TR/xpath-functions-30/#func-path;Returns node path relative to its root
|
||||
fn:prefix-from-QName(QName);https://www.w3.org/TR/xpath-functions-30/#func-prefix-from-QName;Returns the prefix component of the supplied QName
|
||||
fn:QName-equal(QName1, QName2);https://www.w3.org/TR/xpath-functions-30/#func-QName-equal;Returns true if two supplied QNames are equal (namespace URI and local part)
|
||||
fn:serialize(item);https://www.w3.org/TR/xpath-functions-30/#func-serialize;Returns serialized representation
|
||||
fn:tail(sequence);https://www.w3.org/TR/xpath-functions-30/#func-tail;Returns all but the first item in a sequence
|
||||
fn:tokenize(input, separator);https://www.w3.org/TR/xpath-functions-30/#func-tokenize;Splits string wherever a separator is found
|
||||
|
||||
fn:unparsed-text(uri);https://www.w3.org/TR/xpath-functions-30/#func-unparsed-text;Returns text representation of external resource
|
||||
fn:unparsed-text-available(uri);https://www.w3.org/TR/xpath-functions-30/#func-unparsed-text-available;Checks if unparsed-text call would succeed
|
||||
fn:unparsed-text-lines(uri);https://www.w3.org/TR/xpath-functions-30/#func-unparsed-text-lines;Returns strings, one for each line of file
|
||||
fn:uri-collection();https://www.w3.org/TR/xpath-functions-30/#func-uri-collection;Returns a sequence of xs:anyURI values representing the URIs in a resource collection
|
||||
88
FunctionSet/XPath/xsltAll
Normal file
88
FunctionSet/XPath/xsltAll
Normal file
@@ -0,0 +1,88 @@
|
||||
!Templates
|
||||
xsl:template;1.0;https://www.w3.org/TR/xslt-10/#section-Defining-Template-Rules;defines a set of rules to be applied to specified node.
|
||||
xsl:apply-templates;1.0;https://www.w3.org/TR/xslt-10/#section-Applying-Template-Rules;applies a template rule to the current element or to element's child nodes.
|
||||
xsl:apply-imports;1.0;https://www.w3.org/TR/xslt-10/#apply-imports;Applies a template rule from an imported style sheet
|
||||
xsl:apply-templates;1.0;https://www.w3.org/TR/xslt-10/#section-Applying-Template-Rules;Applies a template rule to the current element or to the current element's child nodes
|
||||
xsl:call-template;1.0;https://www.w3.org/TR/xslt-10/#named-templates;Calls a named template
|
||||
xsl:next-match;2.0;https://www.w3.org/TR/xslt20/#element-next-match;overrides another template rule (considers all other template rules of lower import precedence/priority)
|
||||
xsl:mode;3.0;http://www.w3.org/TR/xslt-30/#element-mode;Allows properties of a mode to be defined
|
||||
xsl:override;3.0;http://www.w3.org/TR/xslt-30/#element-override;Allows using package to override selected components from a used package
|
||||
xsl:package;3.0;http://www.w3.org/TR/xslt-30/#element-package;Defines a set of stylesheet modules that can be compiled as a unit
|
||||
xsl:accept;3.0;https://www.w3.org/TR/xslt-30/#element-accept;Allows a package to restrict the visibility of components exposed by a package
|
||||
xsl:global-context-item;3.0;http://www.w3.org/TR/xslt-30/#element-global-context-item;Declares whether a global context item is required, and if so, to declare its required type
|
||||
!Repetition and conditional processing
|
||||
xsl:for-each;1.0;https://www.w3.org/TR/xslt-10/#for-each;Loops through each node in a specified node set
|
||||
xsl:if;1.0;https://www.w3.org/TR/xslt-10/#section-Conditional-Processing;Contains a template that will be applied only if a specified condition is true
|
||||
xsl:choose;1.0;https://www.w3.org/TR/xslt-10/#section-Conditional-Processing-with-xsl:choose;Used in conjunction with <when> and <otherwise> to express multiple conditional tests
|
||||
xsl:when;1.0;https://www.w3.org/TR/xslt-10/#section-Conditional-Processing-with-xsl:choose;Specifies an action for the <choose> element
|
||||
xsl:otherwise;1.0;https://www.w3.org/TR/xslt-10/#section-Conditional-Processing-with-xsl:choose;Specifies a default action for the <choose> element
|
||||
xsl:for-each-group;2.0;https://www.w3.org/TR/xslt20/#element-for-each-group;Groups elements and performs operations once for each group
|
||||
xsl:iterate;3.0;http://www.w3.org/TR/xslt-30/#element-iterate;Used to iterate over a sequence, with the option to set parameters for use in the next iteration
|
||||
xsl:break;3.0;http://www.w3.org/TR/xslt-30/#element-break;Causes premature completion before the entire input sequence has been processed
|
||||
xsl:next-iteration;3.0;http://www.w3.org/TR/xslt-30/#element-next-iteration;The contents are a set of xsl:with-param elements defining the values of the iteration parameters to be used on the next iteration
|
||||
xsl:on-completion;3.0;http://www.w3.org/TR/xslt-30/#element-on-completion;Defines processing to be carried out when the input sequence is exhausted
|
||||
xsl:fork;3.0;http://www.w3.org/TR/xslt-30/#element-fork;The result of the xsl:fork instruction is the sequence formed by concatenating the results of evaluating each of its contained instructions, in order
|
||||
xsl:on-empty;3.0;http://www.w3.org/TR/xslt-30/#element-on-empty;Outputs the enclosed content only if the containing sequence generates no "ordinary" content
|
||||
xsl:on-non-empty;3.0;http://www.w3.org/TR/xslt-30/#element-on-non-empty;Outputs the enclosed content only if the containing sequence also generates "ordinary" content
|
||||
xsl:try;3.0;http://www.w3.org/TR/xslt-30/#element-try;Allows recovery from dynamic errors occurring within the expression it wraps
|
||||
xsl:catch;3.0;http://www.w3.org/TR/xslt-30/#element-catchIn conjunction with xsl:try, handles dynamic errors
|
||||
xsl:context-item;3.0;http://www.w3.org/TR/xslt-30/#element-context-item;Used to declare the initial context item for a template
|
||||
!Creating result tree
|
||||
xsl:attribute;1.0;https://www.w3.org/TR/xslt-10/#creating-attributes;Adds an attribute
|
||||
xsl:attribute-set;1.0;https://www.w3.org/TR/xslt-10/#attribute-sets;Defines a named set of attributes
|
||||
xsl:copy;1.0;https://www.w3.org/TR/xslt-10/#copying;Creates a copy of the current node (without child nodes and attributes)
|
||||
xsl:number;1.0;https://www.w3.org/TR/xslt-10/#number;Determines the integer position of the current node and formats a number
|
||||
xsl:value-of;1.0;https://www.w3.org/TR/xslt-10/#value-of;Extracts the value of a selected node
|
||||
xsl:text;1.0;https://www.w3.org/TR/xslt-10/#section-Creating-Text;Writes literal text to the output
|
||||
xsl:comment;1.0;https://www.w3.org/TR/xslt-10/#section-Creating-Comments;Creates a comment node in the result tree
|
||||
xsl:processing-instruction;1.0;https://www.w3.org/TR/xslt-10/#section-Creating-Processing-Instructions;Writes a processing instruction to the output
|
||||
xsl:key;1.0;https://www.w3.org/TR/xslt-10/#key;Declares a named key that can be used in the style sheet with the key() function
|
||||
xsl:decimal-format;1.0;https://www.w3.org/TR/xslt-10/#format-number;Defines the characters and symbols to be used when converting numbers into strings, with the format-number() function
|
||||
xsl:preserve-space;1.0;https://www.w3.org/TR/xslt-10/#strip;Defines the elements for which white space should be preserved
|
||||
xsl:strip-space;1.0;https://www.w3.org/TR/xslt-10/#strip;Defines the elements for which white space should be removed
|
||||
xsl:sort;1.0;https://www.w3.org/TR/xslt-10/#sorting;Sorts the output
|
||||
xsl:output;1.0;https://www.w3.org/TR/xslt-10/#output;Defines the format of the output document
|
||||
xsl:for-each-group;2.0;https://www.w3.org/TR/xslt20/#element-perform-sort;Sorts given sequence
|
||||
xsl:result-document;2.0;https://www.w3.org/TR/xslt20/#element-result-document;Creates a final result tree
|
||||
xsl:character-map;2.0;https://www.w3.org/TR/xslt20/#element-character-map;Allows a specific character appearing in the final result tree to be substituted by a specified string of characters
|
||||
xsl:output-character;2.0;https://www.w3.org/TR/xslt20/#element-character-map;Defines characters and their replacements to be used by character-map
|
||||
xsl:merge;3.0;http://www.w3.org/TR/xslt-30/#element-merge;Merges two or more pre-sorted input files
|
||||
xsl:merge-action;3.0;http://www.w3.org/TR/xslt-30/#element-merge-action;Defines action to be carried out on each merged group
|
||||
xsl:merge-key;3.0;http://www.w3.org/TR/xslt-30/#element-merge-key;Used to define the merge keys on which the input sequences are sorted
|
||||
xsl:merge-source;3.0;http://www.w3.org/TR/xslt-30/#element-merge-source;Describes the input source for an xsl:merge instruction
|
||||
!Stylesheet structure
|
||||
xsl:stylesheet;1.0;https://www.w3.org/TR/xslt-10/#stylesheet-element;Defines the root element of a style sheet
|
||||
xsl:transform;1.0;https://www.w3.org/TR/xslt-10/#stylesheet-element;Defines the root element of a style sheet
|
||||
xsl:import;1.0;https://www.w3.org/TR/xslt-10/#import;Imports the contents of one style sheet into another. Note: An imported style sheet has lower precedence than the importing style sheet
|
||||
xsl:include;1.0;https://www.w3.org/TR/xslt-10/#include;Includes the contents of one style sheet into another. Note: An included style sheet has the same precedence as the including style sheet
|
||||
xsl:namespace-alias;1.0;https://www.w3.org/TR/xslt-10/#literal-result-element;Replaces a namespace in the style sheet to a different namespace in the output
|
||||
xsl:element;1.0;https://www.w3.org/TR/xslt-10/#section-Creating-Elements-with-xsl:element;Creates an element node in the output document
|
||||
!Variables and parameters
|
||||
xsl:param;1.0;https://www.w3.org/TR/xslt-10/#variables;Declares a local or global parameter
|
||||
xsl:variable;1.0;https://www.w3.org/TR/xslt-10/#variables;Declares a local or global variable
|
||||
xsl:with-param;1.0;https://www.w3.org/TR/xslt-10/#section-Passing-Parameters-to-Templates;Defines the value of a parameter to be passed into a template
|
||||
xsl:copy-of;1.0;https://www.w3.org/TR/xslt-10/#copy-of;Creates a copy of the current node (with child nodes and attributes)
|
||||
xsl:document;2.0;https://www.w3.org/TR/xslt20/#element-document;Creates a new document node
|
||||
xsl:namespace;2.0;https://www.w3.org/TR/xslt20/#element-namespace;Creates a namespace node
|
||||
xsl:namespace-alias;2.0;https://www.w3.org/TR/xslt20/#element-namespace-alias;Declares that a literal namespace URI is being used as an alias for a target namespace URI
|
||||
xsl:sequence;2.0;https://www.w3.org/TR/xslt20/#element-sequence;Constructs a sequence of nodes and/or atomic values
|
||||
!Regular expressions;2.0
|
||||
xsl:analyze-string;2.0;https://www.w3.org/TR/xslt20/#element-analyze-string;Identifies substrings that match given regex
|
||||
xsl:matching-substring;2.0;https://www.w3.org/TR/xslt20/#element-analyze-string;Used in conjunction with analize-string, returns matching substrings
|
||||
xsl:non-matching-substring;2.0;https://www.w3.org/TR/xslt20/#element-analyze-string;Used in conjunction with analize-string, returns substrings that didn't match the regex
|
||||
!Callable;2.0
|
||||
xsl:function;2.0;https://www.w3.org/TR/xslt20/#element-function;Declares a function that can be called from any XPath expression in the stylesheet
|
||||
xsl:evaluate;3.0;http://www.w3.org/TR/xslt-30/#element-evaluate;Allows dynamic evaluation of XPath expressions from a string
|
||||
xsl:assert;3.0;http://www.w3.org/TR/xslt-30/#element-assert;Asserts a XPath expression, optionally throwing a dynamic error
|
||||
!Other elements
|
||||
xsl:message;1.0;https://www.w3.org/TR/xslt-10/#message;Writes a message to the output (used to report errors)
|
||||
xsl:fallback;1.0;https://www.w3.org/TR/xslt-10/#fallback;Specifies an alternate code to run if the processor does not support an XSLT element
|
||||
xsl:map;3.0;http://www.w3.org/TR/xslt-30/#element-map;Used to construct a new map
|
||||
xsl:map-entry;3.0;http://www.w3.org/TR/xslt-30/#element-map-entry;Used to construct a singleton map (one key and one value)
|
||||
xsl:expose;3.0;http://www.w3.org/TR/xslt-30/#element-expose;Used to modify the visibility of selected components within a package
|
||||
xsl:accumulator;3.0;http://www.w3.org/TR/xslt-30/#element-accumulator;Defines a rule that is to be applied while the document is being sequentially processed
|
||||
xsl:accumulator-rule;3.0;http://www.w3.org/TR/xslt-30/#element-accumulator-rule;Defines a rule for an xsl:accumulator
|
||||
xsl:source-document;3.0;http://www.w3.org/TR/xslt-30/#element-source-document;Initiates streamed or unstreamed processing of a source document
|
||||
xsl:use-package;3.0;http://www.w3.org/TR/xslt-30/#element-use-package;
|
||||
xsl:where-populated;3.0;http://www.w3.org/TR/xslt-30/#element-where-populated;Allows conditional content construction to be made streamable
|
||||
xsl:accept;3.0;https://www.w3.org/TR/xslt-30/#element-accept;Allows a package to restrict the visibility of components exposed by a package that it uses
|
||||
8
Homepage/Dockerfile
Normal file
8
Homepage/Dockerfile
Normal file
@@ -0,0 +1,8 @@
|
||||
FROM nginx:stable-alpine
|
||||
|
||||
COPY ./Frontend/ /usr/share/nginx/html/Frontend/
|
||||
COPY ./index.html /usr/share/nginx/html
|
||||
COPY ./logo.png /usr/share/nginx/html
|
||||
COPY ./styles.css /usr/share/nginx/html
|
||||
COPY ./common.css /usr/share/nginx/html
|
||||
COPY ./favicon.ico /usr/share/nginx/html
|
||||
2
Homepage/Frontend/jquery-3.6.0.slim.min.js
vendored
Normal file
2
Homepage/Frontend/jquery-3.6.0.slim.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
25
Homepage/Frontend/new_css/drytest.html
Normal file
25
Homepage/Frontend/new_css/drytest.html
Normal file
@@ -0,0 +1,25 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<head>
|
||||
<link rel="stylesheet" href="r11form.css">
|
||||
<!-- <script src="scripts.js"></script> -->
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
|
||||
<div class="collapsibleList">
|
||||
<button class="section-button collapseTrigger">Node-Set</button>
|
||||
<div class="collapsibleContent">
|
||||
[1.0] <a href="#" onClick="return false;" class="collapseTrigger"><code>fn:last()</code></a>
|
||||
<div class="collapsibleContent">
|
||||
Returns the position of the last node in the context list <br>
|
||||
<code>Link do dokumentacji W3C: <a href="https://www.w3.org/TR/1999/REC-xpath-19991116/#section-Node-Set-Functions" target="_parent">Node-Set-Functions</code></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
BIN
Homepage/Frontend/new_css/font/fontello.eot
Normal file
BIN
Homepage/Frontend/new_css/font/fontello.eot
Normal file
Binary file not shown.
14
Homepage/Frontend/new_css/font/fontello.svg
Normal file
14
Homepage/Frontend/new_css/font/fontello.svg
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg xmlns="http://www.w3.org/2000/svg">
|
||||
<metadata>Copyright (C) 2021 by original authors @ fontello.com</metadata>
|
||||
<defs>
|
||||
<font id="fontello" horiz-adv-x="1000" >
|
||||
<font-face font-family="fontello" font-weight="400" font-stretch="normal" units-per-em="1000" ascent="850" descent="-150" />
|
||||
<missing-glyph horiz-adv-x="1000" />
|
||||
<glyph glyph-name="plus" unicode="" d="M786 439v-107q0-22-16-38t-38-15h-232v-233q0-22-16-37t-38-16h-107q-22 0-38 16t-15 37v233h-232q-23 0-38 15t-16 38v107q0 23 16 38t38 16h232v232q0 22 15 38t38 16h107q23 0 38-16t16-38v-232h232q23 0 38-16t16-38z" horiz-adv-x="785.7" />
|
||||
|
||||
<glyph glyph-name="cancel" unicode="" d="M724 112q0-22-15-38l-76-76q-16-15-38-15t-38 15l-164 165-164-165q-16-15-38-15t-38 15l-76 76q-16 16-16 38t16 38l164 164-164 164q-16 16-16 38t16 38l76 76q16 16 38 16t38-16l164-164 164 164q16 16 38 16t38-16l76-76q15-15 15-38t-15-38l-164-164 164-164q15-15 15-38z" horiz-adv-x="785.7" />
|
||||
</font>
|
||||
</defs>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
BIN
Homepage/Frontend/new_css/font/fontello.ttf
Normal file
BIN
Homepage/Frontend/new_css/font/fontello.ttf
Normal file
Binary file not shown.
BIN
Homepage/Frontend/new_css/font/fontello.woff
Normal file
BIN
Homepage/Frontend/new_css/font/fontello.woff
Normal file
Binary file not shown.
BIN
Homepage/Frontend/new_css/font/fontello.woff2
Normal file
BIN
Homepage/Frontend/new_css/font/fontello.woff2
Normal file
Binary file not shown.
59
Homepage/Frontend/new_css/fontello.css
vendored
Normal file
59
Homepage/Frontend/new_css/fontello.css
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
@font-face {
|
||||
font-family: 'fontello';
|
||||
src: url('font/fontello.eot?49304387');
|
||||
src: url('font/fontello.eot?49304387#iefix') format('embedded-opentype'),
|
||||
url('font/fontello.woff2?49304387') format('woff2'),
|
||||
url('font/fontello.woff?49304387') format('woff'),
|
||||
url('font/fontello.ttf?49304387') format('truetype'),
|
||||
url('font/fontello.svg?49304387#fontello') format('svg');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
/* Chrome hack: SVG is rendered more smooth in Windozze. 100% magic, uncomment if you need it. */
|
||||
/* Note, that will break hinting! In other OS-es font will be not as sharp as it could be */
|
||||
/*
|
||||
@media screen and (-webkit-min-device-pixel-ratio:0) {
|
||||
@font-face {
|
||||
font-family: 'fontello';
|
||||
src: url('../font/fontello.svg?49304387#fontello') format('svg');
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
[class^="icon-"]:before, [class*=" icon-"]:before {
|
||||
font-family: "fontello";
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
speak: never;
|
||||
|
||||
display: inline-block;
|
||||
text-decoration: inherit;
|
||||
width: 1em;
|
||||
margin-right: .2em;
|
||||
text-align: center;
|
||||
/* opacity: .8; */
|
||||
|
||||
/* For safety - reset parent styles, that can break glyph codes*/
|
||||
font-variant: normal;
|
||||
text-transform: none;
|
||||
|
||||
/* fix buttons height, for twitter bootstrap */
|
||||
line-height: 1em;
|
||||
|
||||
/* Animation center compensation - margins should be symmetric */
|
||||
/* remove if not needed */
|
||||
margin-left: .2em;
|
||||
|
||||
/* you can be more comfortable with increased icons size */
|
||||
/* font-size: 120%; */
|
||||
|
||||
/* Font smoothing. That was taken from TWBS */
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
|
||||
/* Uncomment for 3D effect */
|
||||
/* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */
|
||||
}
|
||||
|
||||
.icon-plus:before { content: '\e801'; } /* '' */
|
||||
.icon-cancel:before { content: '\e802'; } /* '' */
|
||||
3
Homepage/Frontend/new_css/main.css
Normal file
3
Homepage/Frontend/new_css/main.css
Normal file
@@ -0,0 +1,3 @@
|
||||
.container {
|
||||
|
||||
}
|
||||
484
Homepage/Frontend/new_css/r11form.css
Normal file
484
Homepage/Frontend/new_css/r11form.css
Normal file
@@ -0,0 +1,484 @@
|
||||
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@300;400;700&display=swap');
|
||||
@import url('https://necolas.github.io/normalize.css/8.0.1/normalize.css');
|
||||
@import url('fontello.css');
|
||||
|
||||
|
||||
.hyperlink, .hyperlink:visited, .hyperlink:active {
|
||||
color: rgb(47, 125, 146);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.hyperlink:hover {
|
||||
filter: brightness(120%);
|
||||
}
|
||||
|
||||
.tooltip-window {
|
||||
position: fixed;
|
||||
right: 0;
|
||||
filter: drop-shadow(-2px 0px 2px darkgray);
|
||||
background: #e8f3f7;
|
||||
padding: 15px 30px;
|
||||
font-family: 'Nunito', sans-serif;
|
||||
width: 40%;
|
||||
height: 100%;
|
||||
overflow: scroll;
|
||||
}
|
||||
|
||||
.tooltip-window.lite {
|
||||
width: 30%;
|
||||
}
|
||||
/* .hyperlink.collapseTrigger::before{
|
||||
content: "▼";
|
||||
} */
|
||||
|
||||
.tooltip-window .tip {
|
||||
}
|
||||
|
||||
.bordered-field {
|
||||
border: 2px solid rgba(93, 99, 96, 0.705);
|
||||
border-radius: 5px;
|
||||
padding: 8px;
|
||||
|
||||
}
|
||||
|
||||
.bordered-field:focus {
|
||||
outline: none;
|
||||
box-shadow: 0 0 5px rgba(81, 203, 238);
|
||||
border: 2px solid #00000070;
|
||||
}
|
||||
|
||||
.bordered-field:disabled {
|
||||
background: #eeeeeed2;
|
||||
}
|
||||
|
||||
.vertically-resizeable {
|
||||
resize: vertical;
|
||||
}
|
||||
|
||||
.container {
|
||||
font-family: 'Nunito', sans-serif;
|
||||
display: flex;
|
||||
justify-content: left;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.tool {
|
||||
width: 55%;
|
||||
display: flex;
|
||||
justify-content: space-evenly;
|
||||
}
|
||||
|
||||
.tool.extended {
|
||||
width: 65%;
|
||||
}
|
||||
|
||||
.tool .tool-context {
|
||||
width: 90%;
|
||||
}
|
||||
|
||||
.tool.extended .tool-context {
|
||||
width: 75%;
|
||||
}
|
||||
|
||||
.tool.extended .tool-extention {
|
||||
width: 20%;
|
||||
padding-top: 2%;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.tool .tool-extention {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.tool-extention {
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.tool-extention.active {
|
||||
opacity: 100%;
|
||||
pointer-events: all;
|
||||
}
|
||||
|
||||
.clickable-text {
|
||||
padding: 0;
|
||||
outline: none;
|
||||
background: none;
|
||||
border: none;
|
||||
font-weight: 300;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.clickable-text.highlight:hover {
|
||||
color: #3bc4f1;
|
||||
}
|
||||
|
||||
.modification-button {
|
||||
padding: 0;
|
||||
outline: none;
|
||||
background: none;
|
||||
border: none;
|
||||
font-weight: 300;
|
||||
}
|
||||
|
||||
.modification-button.btn-add {
|
||||
font-size: 16px;
|
||||
color: #00000030;
|
||||
margin: auto 0 auto 0;
|
||||
}
|
||||
|
||||
.modification-button.btn-add:hover {
|
||||
color:#58ac43;
|
||||
}
|
||||
|
||||
.modification-button.btn-tile:hover {
|
||||
color: #ca1111;
|
||||
}
|
||||
|
||||
.modification-button.btn-hashmap {
|
||||
font-size: 16px;
|
||||
color: #00000030;
|
||||
margin: auto 0 auto 0;
|
||||
}
|
||||
|
||||
.modification-button.btn-hashmap:hover {
|
||||
color: #ca1111;
|
||||
}
|
||||
|
||||
.modification-button.btn-tile {
|
||||
width: 10%;
|
||||
margin: 20% 0 0 0;
|
||||
font-size: 14px;
|
||||
color: #00000020
|
||||
}
|
||||
|
||||
.tile {
|
||||
width: 90%;
|
||||
padding-top: 40%;
|
||||
border: 1px solid gray;
|
||||
border-radius: 3px;
|
||||
position: relative;
|
||||
background: #f0f0f095;
|
||||
margin-bottom: 10px;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.tile:hover {
|
||||
filter: brightness(110%);
|
||||
}
|
||||
|
||||
.tile.active {
|
||||
background: #00000070;
|
||||
color: white;
|
||||
filter: none;
|
||||
}
|
||||
|
||||
.tile .content {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
padding: 0 2% 0 7%;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.text-aligned-to-right {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.centered-vertically {
|
||||
margin-top: auto;
|
||||
margin-bottom: auto;
|
||||
}
|
||||
|
||||
.display-space-between {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.content p {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
|
||||
.float-left {
|
||||
display: flex;
|
||||
justify-content: left;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.version-span {
|
||||
font-size: 13px;
|
||||
font-weight: 400;
|
||||
color: rgba(85,85,85,0.555);
|
||||
}
|
||||
|
||||
.block-display {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.block-label {
|
||||
display: block;
|
||||
margin: 0 0 0 5px;
|
||||
}
|
||||
|
||||
.tabmenu {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
text-align: center;
|
||||
border-bottom: 1px solid rgba(185, 185, 185, 0.5);
|
||||
}
|
||||
|
||||
.tabitem {
|
||||
flex-grow: 1;
|
||||
cursor: pointer;
|
||||
padding: 5px 0;
|
||||
}
|
||||
|
||||
.tabitem:hover {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.tabitem.active {
|
||||
background: rgba(33, 34, 34, 0.705);
|
||||
color: white;
|
||||
font-weight: 700;
|
||||
cursor:default;
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
.big-font {
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.action-button.active {
|
||||
background: #3bc4f1;
|
||||
border: 1px solid #7ed0eb;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.action-button.active:hover {
|
||||
filter: brightness(110%);
|
||||
}
|
||||
|
||||
.action-button {
|
||||
background: rgba(155, 165, 160, 0.507);
|
||||
border:1px solid rgba(186, 197, 191, 0.507);
|
||||
color: white;
|
||||
padding: 10px 20px;
|
||||
font-weight: 700;
|
||||
margin: 3px 0;
|
||||
}
|
||||
|
||||
.quater-width {
|
||||
width: 25%;
|
||||
}
|
||||
|
||||
.half-width {
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.half-width.with-padding {
|
||||
width: 45%;
|
||||
}
|
||||
|
||||
.max-width {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.max-width.with-padding {
|
||||
width: 94%;
|
||||
}
|
||||
|
||||
.max-height {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.height-300 {
|
||||
height: 300px;
|
||||
}
|
||||
|
||||
.max-height.with-padding {
|
||||
height: 90%;
|
||||
}
|
||||
|
||||
.small-margins {
|
||||
margin: 3%;
|
||||
}
|
||||
|
||||
.small-vertical-margin {
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.medium-vertical-margin {
|
||||
margin-top: 30px;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.large-vertical-margin {
|
||||
margin-top: 50px;
|
||||
margin-bottom: 50px;
|
||||
}
|
||||
|
||||
.textarea-300 {
|
||||
height: 300px;
|
||||
}
|
||||
|
||||
.centered-content {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.table-map {
|
||||
width: 60%;
|
||||
}
|
||||
|
||||
.table-map input{
|
||||
font-size: 16px;
|
||||
padding: 7px;
|
||||
border: 1px solid rgba(145, 146, 146, 0.849);
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.table-map input.key {
|
||||
background: #f0f0f0;
|
||||
}
|
||||
|
||||
.table-default {
|
||||
width: 80%;
|
||||
border-collapse: collapse;
|
||||
border-spacing: 0;
|
||||
}
|
||||
|
||||
.table-default tr {
|
||||
background: #f0f0f02d;
|
||||
}
|
||||
|
||||
.table-default tr.bottom-border {
|
||||
border-bottom: 1px solid black;
|
||||
}
|
||||
|
||||
.table-default th {
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.table-default tr.even {
|
||||
background: #f0f0f0;
|
||||
}
|
||||
|
||||
.tip {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.tip.active {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.tabcontent {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.tabcontent.active {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.section-button {
|
||||
width: 100%;
|
||||
padding: 15px 0;
|
||||
font-size: 18px;
|
||||
background: #b4b4b4c5;
|
||||
cursor: pointer;
|
||||
border-bottom: darkgray 2px solid !important;
|
||||
}
|
||||
|
||||
.section-button:hover {
|
||||
/* border-bottom: #3bc4f1 2px solid; */
|
||||
backdrop-filter: brightness(110%);
|
||||
}
|
||||
|
||||
.section-button .active {
|
||||
background: #00000030;
|
||||
}
|
||||
|
||||
.List .collapsibleContent {
|
||||
/* display: none; */
|
||||
border-left: #bdc5c9 2px solid;
|
||||
|
||||
/* max-height: 0px; */
|
||||
/* border-left: #ededed solid 1px; */
|
||||
overflow: hidden;
|
||||
background: #ffffff50;
|
||||
}
|
||||
|
||||
.section{
|
||||
padding: 10px 0px 20px 0px ;
|
||||
}
|
||||
|
||||
.content {
|
||||
padding: 0px 15px 0px 15px ;
|
||||
text-align: justify;
|
||||
overflow: hidden;
|
||||
transition: max-height .2s ease-out;
|
||||
max-height: 0px;
|
||||
border-left: #c0c2c3 2px solid;
|
||||
|
||||
}
|
||||
|
||||
.collapsibleMini::before{
|
||||
content: "►";
|
||||
}
|
||||
|
||||
.collapsibleMini.active::before{
|
||||
content: "▼";
|
||||
}
|
||||
|
||||
.content.active{
|
||||
|
||||
}
|
||||
|
||||
.hiddable {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.hiddable.active {
|
||||
display: inherit;
|
||||
}
|
||||
|
||||
/* In case of collision with classes that use 'active' */
|
||||
.hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
button:hover{
|
||||
filter: brightness(110%);
|
||||
}
|
||||
|
||||
.table-doc td, .table-doc th{
|
||||
border-spacing: 0px;
|
||||
padding: 0px 10px;
|
||||
}
|
||||
|
||||
.table-doc td {
|
||||
background-color: rgba(155, 165, 160, 0.342);
|
||||
}
|
||||
|
||||
.table-doc th {
|
||||
background-color: #3bc4f1;
|
||||
text-align: left;
|
||||
color: white;
|
||||
}
|
||||
|
||||
textarea {
|
||||
-webkit-box-sizing: border-box;
|
||||
-moz-box-sizing: border-box;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
code{
|
||||
line-height: 150%;
|
||||
}
|
||||
33
Homepage/Frontend/sample_data/sample_xml.xml
Normal file
33
Homepage/Frontend/sample_data/sample_xml.xml
Normal file
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<l:library xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.release11.com" xmlns:l="http://www.release11.com/library" xmlns:p="http://www.release11.com/person" xmlns:b="http://www.release11.com/book">
|
||||
<l:libraryName>City library</l:libraryName>
|
||||
<l:libraryID>345123</l:libraryID>
|
||||
<l:readerList>
|
||||
<p:person>
|
||||
<p:readerID>7321</p:readerID>
|
||||
<p:name>Adam</p:name>
|
||||
<p:surname>Choke</p:surname>
|
||||
</p:person>
|
||||
<p:person>
|
||||
<p:readerID>5123</p:readerID>
|
||||
<p:name>Lauren</p:name>
|
||||
<p:surname>Wong</p:surname>
|
||||
</p:person>
|
||||
</l:readerList>
|
||||
<l:bookList>
|
||||
<b:book>
|
||||
<b:bookID>6422</b:bookID>
|
||||
<b:title>Harry Potter</b:title>
|
||||
<p:readerID>7542</p:readerID>
|
||||
</b:book>
|
||||
<b:book>
|
||||
<b:bookID>1234</b:bookID>
|
||||
<b:title>Macbeth</b:title>
|
||||
<p:readerID>5123</p:readerID>
|
||||
</b:book>
|
||||
<b:book>
|
||||
<b:bookID>9556</b:bookID>
|
||||
<b:title>Romeo and Juliet</b:title>
|
||||
</b:book>
|
||||
</l:bookList>
|
||||
</l:library>
|
||||
156
Homepage/Frontend/scripts.js
Normal file
156
Homepage/Frontend/scripts.js
Normal file
@@ -0,0 +1,156 @@
|
||||
var defaultStrings = [];
|
||||
const color_grey = "#6b6b6b";
|
||||
const color_red = "#ff8f8f";
|
||||
|
||||
//Remove default text and set color to black
|
||||
function clearDefaultContent(element, text) {
|
||||
if (element.value == text) {
|
||||
element.value = "";
|
||||
element.style.color = "#000000";
|
||||
element.style.backgroundColor = "#ffffff";
|
||||
}
|
||||
}
|
||||
|
||||
//Set default text in grey
|
||||
function setDefaultContent(element, text) {
|
||||
if (element.value == "") {
|
||||
var id = element.getAttribute('id');
|
||||
if (!defaultStrings.includes(text)) {
|
||||
defaultStrings.push(text);
|
||||
}
|
||||
if (id == "xmlArea") {
|
||||
element.style.color = color_grey;
|
||||
element.value = text;
|
||||
}
|
||||
if (id == "transformArea") {
|
||||
element.style.color = color_grey;
|
||||
element.value = text;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function hideList(collList) {
|
||||
for (i = 0; i < collList.length; i++) {
|
||||
if (collList[i].nextElementSibling !== null) {
|
||||
collList[i].nextElementSibling.style.maxHeight = null;
|
||||
collList[i].nextElementSibling.classList.toggle("collapsibleDataExpanded", false);
|
||||
}
|
||||
collList[i].style.display = 'none';
|
||||
collList[i].classList.remove("collapsibleActive");
|
||||
}
|
||||
}
|
||||
|
||||
function checkDefault(text){
|
||||
return defaultStrings.includes(text);
|
||||
}
|
||||
|
||||
function showList(collList) {
|
||||
for (i = 0; i < collList.length; i++) {
|
||||
collList[i].style.display = 'block';
|
||||
}
|
||||
}
|
||||
|
||||
function smoothFoldElement(element, toogleState, toggleParrent){
|
||||
if (toogleState) {
|
||||
console.log("DUPA");
|
||||
if(toggleParrent){
|
||||
element.parentElement.style.maxHeight = "0px";
|
||||
}
|
||||
|
||||
element.classList.toggle("active", false);
|
||||
var subLists = collapsibleData.getElementsByClassName("collapsibleData");
|
||||
for (j = 0; j < subLists.length; j++) {
|
||||
subLists[j].style.maxHeight = null;
|
||||
}
|
||||
} else {
|
||||
collapsibleData.parentElement.style.maxHeight = (collapsibleData.parentElement.scrollHeight) + "px";
|
||||
collapsibleData.classList.toggle("active", true);
|
||||
if (collapsibleData.parentElement.classList.contains("collapsibleData") && collapsibleData.parentElement.classList.contains("active")) {
|
||||
collapsibleData.parentElement.style.maxHeight = (collapsibleData.parentElement.scrollHeight + collapsibleData.scrollHeight) + "px";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Set tooltip info, function is called by onClick handlers
|
||||
function refreshTooltip() {
|
||||
var resizeList = document.getElementsByClassName("collapsibleData");
|
||||
console.log("collDataList: " + resizeList.length)
|
||||
document.getElementById("processorTooltipInfo").innerText = procInfo;
|
||||
document.getElementById("xsltelementsheader").innerText = XSLTheader;
|
||||
}
|
||||
|
||||
function performRequest(text, checkXML, checkTransform){
|
||||
var xmlData = document.getElementById("xmlArea").value.trim();
|
||||
var transformData = document.getElementById("transformArea").value.trim();
|
||||
|
||||
var empty = false;
|
||||
if (defaultStrings.includes(xmlData) && checkXML) {
|
||||
document.getElementById("xmlArea").style.backgroundColor = color_red;
|
||||
xmlData = "";
|
||||
empty = true;
|
||||
}
|
||||
if (defaultStrings.includes(transformData) && checkTransform) {
|
||||
document.getElementById("transformArea").style.backgroundColor = color_red;
|
||||
empty = true;
|
||||
}
|
||||
if (!empty) {
|
||||
restRequest(text);
|
||||
}else{
|
||||
document.getElementById("resultArea").value = "No data provided!";
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//Form REST request, send, receive and display in resultArea
|
||||
async function restRequest(text) {
|
||||
const escapeChar = "specialEscapeChar";
|
||||
// const addr = "http://localhost:8081/" + text;
|
||||
const addr = "http://gordon.zipper.release11.com:8081/" + text;
|
||||
|
||||
var xmlData = document.getElementById("xmlArea").value.trim();
|
||||
var transformData = document.getElementById("transformArea").value.trim();
|
||||
|
||||
if(defaultStrings.includes(xmlData)){
|
||||
xmlData = "<empty/>";
|
||||
}
|
||||
|
||||
// var data = xmlData.concat(escapeChar, transformData);
|
||||
|
||||
// const url = addr.concat("?escapechar=", escapeChar, "&processor=", getProcInfo());
|
||||
|
||||
var jsonData = JSON.stringify({
|
||||
"data" : xmlData,
|
||||
"process" : transformData,
|
||||
"processor" : getProcessor(),
|
||||
"version" : getVersion()
|
||||
});
|
||||
// console.log(jsonData);
|
||||
var init = {
|
||||
headers: new Headers({
|
||||
}),
|
||||
body: jsonData,
|
||||
// body: data,
|
||||
method: "POST"
|
||||
};
|
||||
var request = new Request(addr, init);
|
||||
|
||||
|
||||
|
||||
await fetch(request).then(response => {
|
||||
console.log(response.status);
|
||||
response.text().then(function (text) {
|
||||
console.log(text);
|
||||
var result = JSON.parse(text);
|
||||
document.getElementById("resultArea").value = result.result;
|
||||
document.getElementById("procinfo").innerText = ' Computed using '.concat(" ", result.processor);
|
||||
if (response.ok) {
|
||||
document.getElementById("procinfo").innerText = document.getElementById("procinfo").innerText.concat(" in ", result.time, "ms");
|
||||
procinfo.style.color = "#30aa58";
|
||||
} else {
|
||||
procinfo.style.color = "#aa3030";
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
100
Homepage/Frontend/styles.css
Normal file
100
Homepage/Frontend/styles.css
Normal file
@@ -0,0 +1,100 @@
|
||||
html, body {
|
||||
margin: 0px;
|
||||
height: 100%;
|
||||
min-height: 100%;
|
||||
font-family: 'Nunito', sans-serif;
|
||||
}
|
||||
|
||||
select {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
button#requestButton {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
div#content {
|
||||
width: 100%;
|
||||
min-height: 100%;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
div#fields {
|
||||
float: left;
|
||||
width: 55%;
|
||||
margin-left: 8px;
|
||||
margin-right: 8px;
|
||||
height: 100%;
|
||||
margin-bottom: 60px;
|
||||
}
|
||||
|
||||
p {
|
||||
margin: 1
|
||||
}
|
||||
|
||||
label {
|
||||
font-size: 20px;
|
||||
color: rgb(44, 44, 44);
|
||||
}
|
||||
|
||||
textarea {
|
||||
width: 99.4%;
|
||||
resize: vertical;
|
||||
color: #6b6b6b;
|
||||
}
|
||||
|
||||
textarea#resultArea {
|
||||
width: 99.4%;
|
||||
resize: vertical;
|
||||
}
|
||||
|
||||
span#procinfo {
|
||||
color: #30aa58;
|
||||
}
|
||||
|
||||
p#tooltipText {
|
||||
width: 200px;
|
||||
height: 150px;
|
||||
}
|
||||
|
||||
div#tooltip {
|
||||
margin-top: 160px;
|
||||
float: right;
|
||||
width: 40%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.collapsible {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.collapsible.active {
|
||||
background-color: rgb(129, 129, 129) !important;
|
||||
}
|
||||
|
||||
.collapsibleData {
|
||||
transition: max-height .2s ease-out;
|
||||
max-height: 0px;
|
||||
}
|
||||
|
||||
.docTable td, .docTable th{
|
||||
border-spacing: 0px;
|
||||
padding: 0px 10px;
|
||||
}
|
||||
|
||||
.docTable td {
|
||||
background-color: rgba(155, 165, 160, 0.342);
|
||||
}
|
||||
|
||||
.docTable th {
|
||||
background-color: #3bc4f1;
|
||||
text-align: left;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.collapsibleDataMini{
|
||||
/* border-radius: 10px; */
|
||||
border: solid rgba(137, 146, 142, 0.267);
|
||||
border-width: 0px 0px 0px 3px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
1094
Homepage/Frontend/xpath (copy).html
Normal file
1094
Homepage/Frontend/xpath (copy).html
Normal file
File diff suppressed because it is too large
Load Diff
3208
Homepage/Frontend/xpath.html
Normal file
3208
Homepage/Frontend/xpath.html
Normal file
File diff suppressed because it is too large
Load Diff
171
Homepage/Frontend/xsd.html
Normal file
171
Homepage/Frontend/xsd.html
Normal file
@@ -0,0 +1,171 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<!-- <link rel="stylesheet" href="styles.css"> -->
|
||||
<link rel="stylesheet" href="new_css/r11form.css">
|
||||
<script src="scripts.js"></script>
|
||||
<meta charset="utf-8" />
|
||||
</head>
|
||||
|
||||
<body onload="init();">
|
||||
<div class="container">
|
||||
<div id="tool" class="tool">
|
||||
<div class="tool-context">
|
||||
<div class="headline">
|
||||
<h1>Online XSD tester <span class="versionInfo"><span class="version-span">v0.4 BETA</span></span>
|
||||
</h1>
|
||||
</div>
|
||||
<label for="processors">Select XSLT processor:</label>
|
||||
<select name="processors" id="processors">
|
||||
<!-- <option value="saxon">Saxon</option> -->
|
||||
<option value="xalan">Xalan</option>
|
||||
</select>
|
||||
<!-- <span id="processorTooltipInfo">procInfo</span><br> -->
|
||||
<br>
|
||||
|
||||
<label for="xmlArea"><b>Insert your XML:</b></label>
|
||||
<textarea id="xmlArea" name="xmlArea" rows="15"
|
||||
class="textarea-300 bordered-field vertically-resizeable max-width"
|
||||
onblur="setDefaultContent(this, 'Insert XML here');"
|
||||
onfocus="clearDefaultContent(this, 'Insert XML here');"></textarea>
|
||||
<br><br>
|
||||
|
||||
<label for="transformArea"><b>Insert your XSD:</b></label>
|
||||
<textarea id="transformArea" name="transformArea" rows="15"
|
||||
class="textarea-300 bordered-field vertically-resizeable max-width"
|
||||
onblur="setDefaultContent(this, 'Insert XSD here');"
|
||||
onfocus="clearDefaultContent(this, 'Insert XSD here');"></textarea>
|
||||
<br>
|
||||
<button id="requestButton" class="max-width block-label action-button active"
|
||||
onclick="performRequest('xsdpost', true, true)">Verify XSD</button>
|
||||
<br><br>
|
||||
|
||||
<label for="resultArea"><b>Result:<span id="procinfo"></span></b></label>
|
||||
<textarea id="resultArea" name="resultArea" rows="2"
|
||||
class="bordered-field vert2ically-resizeable max-width" style="margin-bottom: 50px;"></textarea>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tooltip-window">
|
||||
<h2>What is XSD?</h2>
|
||||
<p><b>XSD is a W3C recomedation that specifies how to describe the elements in XML document</b></p>
|
||||
<p>XSD specifies data types, order and arity of elements in XML file.<br>
|
||||
Main components of XSD file are:<br>
|
||||
- Element declaration - declares properties of elements (names and namespaces)<br>
|
||||
- Attribute declarations - declares properties of attributes<br>
|
||||
- Simple and complex types:<br>
|
||||
- - XSD provides 19 simple data types<br>
|
||||
- - More complex types are declared using simple types and relationships<br>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<!-- <script>
|
||||
function getVersion() {
|
||||
return document.getElementById("versions").value;
|
||||
}
|
||||
</script> -->
|
||||
<script>
|
||||
function processTooltip() {
|
||||
console.log("processTooltip");
|
||||
|
||||
|
||||
if (getProcInfo() == "xalan") {
|
||||
document.getElementById("tooltipFunctionInfo").innerText = "XSLT 1.0 functions";
|
||||
document.getElementById("processorTooltipInfo").innerText = "Supports XSLT 1.0";
|
||||
hideList(document.getElementsByName("collapse30"));
|
||||
} else {
|
||||
document.getElementById("tooltipFunctionInfo").innerText = "XSLT 1.0, 2.0 & 3.0 functions";
|
||||
document.getElementById("processorTooltipInfo").innerText = "Supports XSLT up to 3.0";
|
||||
showList(document.getElementsByName("collapse30"));
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
function getProcessor() {
|
||||
return document.getElementById("processors").value;
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
function getVersion() {
|
||||
if (getProcInfo() == "xalan") {
|
||||
return "1.0";
|
||||
} else {
|
||||
return "3.0";
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
function getProcInfo() {
|
||||
var processVariables = document.getElementById("processors").value;// + "&version=" + document.getElementById("versions").value;
|
||||
return processVariables;
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
var triggerList = document.getElementsByClassName("collapseTrigger");
|
||||
for (i = 0; i < triggerList.length; i++) {
|
||||
console.log("trigger connected");
|
||||
triggerList[i].addEventListener("click", function () {
|
||||
console.log("click");
|
||||
var collapsible = this.parentElement;
|
||||
var collapsibleData = this.nextElementSibling;
|
||||
if (collapsibleData.style.maxHeight > "0px") {
|
||||
collapsibleData.style.maxHeight = "0px";
|
||||
|
||||
this.classList.toggle("active", false);
|
||||
if (!this.classList.contains("collapsibleMini")) {
|
||||
collapsible.classList.toggle("active", false);
|
||||
}
|
||||
|
||||
var subLists1 = collapsibleData.getElementsByClassName("content");
|
||||
var subLists2 = collapsibleData.getElementsByClassName("active");
|
||||
for (j = 0; j < subLists1.length; j++) {
|
||||
subLists1[j].style.maxHeight = "0px";
|
||||
}
|
||||
for (j = 0; j < subLists2.length; j++) {
|
||||
subLists2[j].classList.toggle("active", false);
|
||||
}
|
||||
} else {
|
||||
collapsibleData.style.maxHeight = (collapsibleData.scrollHeight) + "px";
|
||||
|
||||
this.classList.toggle("active", true);
|
||||
if (!this.classList.contains("collapsibleMini")) {
|
||||
collapsible.classList.toggle("active", true);
|
||||
} else {
|
||||
var parentContent = this.closest(".content");
|
||||
parentContent.style.maxHeight = (parentContent.scrollHeight + collapsibleData.scrollHeight) + "px";
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
function init() {
|
||||
//Handle clicks in whole form and set info in tooltip
|
||||
setDefaultContent(document.getElementById("xmlArea"), 'Insert XML here');
|
||||
setDefaultContent(document.getElementById("transformArea"), 'Insert XSD here');
|
||||
console.log("init");
|
||||
// refreshTooltip();
|
||||
processTooltip();
|
||||
tool.addEventListener('click', event => {
|
||||
//Check if script was called from textarea or selector
|
||||
var targetID = event.target.getAttribute('id');
|
||||
if (targetID !== "processors" && targetID !== "xmlArea" && targetID !== "transformArea" && targetID !== "versions") {
|
||||
return;
|
||||
}
|
||||
|
||||
processTooltip();
|
||||
// console.log("clock");
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
540
Homepage/Frontend/xslt (copy).html
Normal file
540
Homepage/Frontend/xslt (copy).html
Normal file
@@ -0,0 +1,540 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<!-- <link rel="stylesheet" href="styles.css"> -->
|
||||
<link rel="stylesheet" href="new_css/r11form.css">
|
||||
<script src="scripts.js"></script>
|
||||
</head>
|
||||
|
||||
<body onload="init();">
|
||||
<div class="container">
|
||||
<div id="tool" class="tool">
|
||||
<div class="tool-context">
|
||||
<div class="headline">
|
||||
<h1>Online XSLT tester <span class="versionInfo"><span class="version-span">v0.4</span></span></h1>
|
||||
</div>
|
||||
<label for="processors">Select XSLT processor:</label>
|
||||
<select name="processors" id="processors">
|
||||
<option value="saxon">Saxon</option>
|
||||
<option value="xalan">Xalan</option>
|
||||
</select>
|
||||
<span id="processorTooltipInfo">procInfo</span><br>
|
||||
<br>
|
||||
|
||||
<label for="xmlArea"><b>Insert your XML:</b></label>
|
||||
<textarea id="xmlArea" name="xmlArea" rows="15"
|
||||
class="textarea-300 bordered-field vertically-resizeable max-width"
|
||||
onblur="setDefaultContent(this, 'Insert XML here');"
|
||||
onfocus="clearDefaultContent(this, 'Insert XML here');"></textarea>
|
||||
<br><br>
|
||||
|
||||
<label for="transformArea"><b>Insert your XSLT:</b></label>
|
||||
<textarea id="transformArea" name="transformArea" rows="15"
|
||||
class="textarea-300 bordered-field vertically-resizeable max-width"
|
||||
onblur="setDefaultContent(this, 'Insert XSLT here');"
|
||||
onfocus="clearDefaultContent(this, 'Insert XSLT here');"></textarea>
|
||||
<br>
|
||||
<button id="requestButton" class="max-width block-label action-button active"
|
||||
onclick="performRequest('xsltpost', true, true)">Execute XSLT transform</button>
|
||||
<br><br>
|
||||
|
||||
<label for="resultArea"><b>Transform result:<span id="procinfo"></span></b></label>
|
||||
<textarea id="resultArea" name="resultArea" rows="10"
|
||||
class="textarea-300 bordered-field vertically-resizeable max-width"></textarea>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="tooltip tooltip-window">
|
||||
<h2>What is XSLT?</h2>
|
||||
<p>XSLT is a language for transforming XML documents into other documents such as XML, HTML and many
|
||||
other.<br></p>
|
||||
<span id="collapsible-lists">
|
||||
<div class="collapsible">
|
||||
<button class="section-button collapseTrigger" style="border: none" style="border: none">XSLT 1.0 vs
|
||||
2.0
|
||||
vs 3.0</button>
|
||||
<div class="content">
|
||||
<p><b>XSLT 2.0 introduced a host of new features:</b><br>
|
||||
- Strong typing and all XSD types<br>
|
||||
- The ability to define and write own functions<br>
|
||||
- node-set() - replaces XSLT's 1.0 Result Tree Fragment, creating fully functional tree<br>
|
||||
- New functions and operators:<br>
|
||||
- - XPath 2.0<br>
|
||||
- - String processing and regular expressions<br>
|
||||
- - Grouping (for-each-group function)
|
||||
- - String processing<br>
|
||||
- - Sequence type<br>
|
||||
</p>
|
||||
<p><b>XSLT 3.0 further improved the formula:</b><br>
|
||||
- Streaming tranformations (previously file had to be loaded to memory to be processed)<br>
|
||||
- Packages - improve the modularity of large stylesheets<br>
|
||||
- Improved error handling (for example <code><xsl:try></code>)<br>
|
||||
- Support for maps and arrays, enabling XSLT to handle JSON as well as XML<br>
|
||||
- Functions can now be arguments to other (higher-order) functions
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2><span id="tooltipFunctionInfo">XSLT 1.0, 2.0 & 3.0 functions</span></h2>
|
||||
<div class="collapsible">
|
||||
<button class="section-button collapseTrigger" style="border: none">Templates</button>
|
||||
<div class="content">
|
||||
|
||||
[v1.0] <a href="https://www.w3.org/TR/xslt-10/#section-Defining-Template-Rules"
|
||||
target="_blank"><code><xsl:template></code></a> - defines a set of rules to be
|
||||
applied to
|
||||
specified node.<br>
|
||||
[v1.0] <a href="https://www.w3.org/TR/xslt-10/#section-Applying-Template-Rules"
|
||||
target="_blank"><code><xsl:apply-templates></code></a> - applies a template rule to
|
||||
the
|
||||
current element or to element's child nodes.<br>
|
||||
[v1.0] <a href="https://www.w3.org/TR/xslt-10/#apply-imports"
|
||||
target="_blank"><code><xsl:apply-imports></code></a> - Applies a template rule from
|
||||
an
|
||||
imported style sheet<br>
|
||||
[v1.0] <a href="https://www.w3.org/TR/xslt-10/#section-Applying-Template-Rules"
|
||||
target="_blank"><code><xsl:apply-templates></code></a> - Applies a template rule to
|
||||
the
|
||||
current element or to the current element's child nodes<br>
|
||||
[v1.0] <a href="https://www.w3.org/TR/xslt-10/#named-templates"
|
||||
target="_blank"><code><xsl:call-template></code></a> - Calls a named template
|
||||
<span name="collapse2">[v2.0] <a href="https://www.w3.org/TR/xslt20/#element-next-match"
|
||||
target="_blank"><code><xsl:next-match></code></a> - overrides another template
|
||||
rule
|
||||
(considers all other template rules of lower import precedence/priority)<br></span>
|
||||
<span name="collapse2">[v3.0] <a href="http://www.w3.org/TR/xslt-30/#element-mode"
|
||||
target="_blank"><code><xsl:mode></code></a> - Allows properties of a mode to be
|
||||
defined<br></span>
|
||||
<span name="collapse2">[v3.0] <a href="http://www.w3.org/TR/xslt-30/#element-override"
|
||||
target="_blank"><code><xsl:override></code></a> - Allows using package to
|
||||
override
|
||||
selected components from a used package<br></span>
|
||||
<span name="collapse2">[v3.0] <a href="http://www.w3.org/TR/xslt-30/#element-package"
|
||||
target="_blank"><code><xsl:package></code></a> - Defines a set of stylesheet
|
||||
modules
|
||||
that can be compiled as a unit<br></span>
|
||||
<span name="collapse2">[v3.0] <a href="https://www.w3.org/TR/xslt-30/#element-accept"
|
||||
target="_blank"><code><xsl:accept></code></a> - Allows a package to restrict the
|
||||
visibility of components exposed by a package<br></span>
|
||||
<span name="collapse2">[v3.0] <a
|
||||
href="http://www.w3.org/TR/xslt-30/#element-global-context-item"
|
||||
target="_blank"><code><xsl:global-context-item></code></a> - Declares whether a
|
||||
global context item is required, and if so, to declare its required type</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapsible">
|
||||
<button class="section-button collapseTrigger" style="border: none">Repetition and Conditional
|
||||
processing</button>
|
||||
<div class="content">
|
||||
[v1.0] <a href="https://www.w3.org/TR/xslt-10/#for-each"
|
||||
target="_blank"><code><xsl:for-each></code></a> - Loops through each node in a
|
||||
specified
|
||||
node set<br>
|
||||
[v1.0] <a href="https://www.w3.org/TR/xslt-10/#section-Conditional-Processing"
|
||||
target="_blank"><code><xsl:if></code></a> - Contains a template that will be applied
|
||||
only if a specified condition is true<br>
|
||||
[v1.0] <a href="https://www.w3.org/TR/xslt-10/#section-Conditional-Processing-with-xsl:choose"
|
||||
target="_blank"><code><xsl:choose></code></a> - Used in conjunction with <when>
|
||||
and
|
||||
<otherwise> to express multiple conditional tests<br>
|
||||
[v1.0] <a href="https://www.w3.org/TR/xslt-10/#section-Conditional-Processing-with-xsl:choose"
|
||||
target="_blank"><code><xsl:when></code></a> - Specifies an action for the
|
||||
<choose> element<br>
|
||||
[v1.0] <a href="https://www.w3.org/TR/xslt-10/#section-Conditional-Processing-with-xsl:choose"
|
||||
target="_blank"><code><xsl:otherwise></code></a> - Specifies a default
|
||||
action for the <choose> element<br>
|
||||
<span name="collapse2">[v2.0] <a href="https://www.w3.org/TR/xslt20/#element-for-each-group"
|
||||
target="_blank"><code><xsl:for-each-group></code></a> - Groups
|
||||
elements and performs operations once for each group<br></span>
|
||||
<span name="collapse2">[v3.0] <a href="http://www.w3.org/TR/xslt-30/#element-iterate"
|
||||
target="_blank"><code><xsl:iterate></code></a> - Used to iterate
|
||||
over a sequence, with the option to set parameters for use in the next
|
||||
iteration<br></span>
|
||||
<span name="collapse2">[v3.0] <a href="http://www.w3.org/TR/xslt-30/#element-break"
|
||||
target="_blank"><code><xsl:break></code></a> - Causes premature
|
||||
completion before the entire input sequence has been processed<br></span>
|
||||
<span name="collapse2">[v3.0] <a href="http://www.w3.org/TR/xslt-30/#element-next-iteration"
|
||||
target="_blank"><code><xsl:next-iteration></code></a> - The
|
||||
contents
|
||||
are a set of xsl:with-param elements defining the values of the iteration
|
||||
parameters to be used on the next iteration<br></span>
|
||||
<span name="collapse2">[v3.0] <a href="http://www.w3.org/TR/xslt-30/#element-on-completion"
|
||||
target="_blank"><code><xsl:on-completion></code></a> - Defines
|
||||
processing to be carried out when the input sequence is exhausted<br></span>
|
||||
<span name="collapse2">[v3.0] <a href="http://www.w3.org/TR/xslt-30/#element-fork"
|
||||
target="_blank"><code><xsl:fork></code></a> - The result of the
|
||||
xsl:fork instruction is the sequence formed by concatenating the results of
|
||||
evaluating each of its contained instructions, in order<br></span>
|
||||
<span name="collapse2">[v3.0] <a href="http://www.w3.org/TR/xslt-30/#element-on-empty"
|
||||
target="_blank"><code><xsl:on-empty></code></a> - Outputs the
|
||||
enclosed content only if the containing sequence generates no "ordinary"
|
||||
content<br></span>
|
||||
<span name="collapse2">[v3.0] <a href="http://www.w3.org/TR/xslt-30/#element-on-non-empty"
|
||||
target="_blank"><code><xsl:on-non-empty></code></a> - Outputs the
|
||||
enclosed content only if the containing sequence also generates "ordinary"
|
||||
content<br></span>
|
||||
<span name="collapse2">[v3.0] <a href="http://www.w3.org/TR/xslt-30/#element-try"
|
||||
target="_blank"><code><xsl:try></code></a> - Allows recovery from
|
||||
dynamic errors occurring within the expression it wraps<br></span>
|
||||
<span name="collapse2">[v3.0] <a href="http://www.w3.org/TR/xslt-30/#element-catch"
|
||||
target="_blank"><code><xsl:catch></code></a> - In conjunction
|
||||
with
|
||||
xsl:try, handles dynamic errors<br></span>
|
||||
<span name="collapse2">[v3.0] <a href="http://www.w3.org/TR/xslt-30/#element-context-item"
|
||||
target="_blank"><code><xsl:context-item></code></a> - Used to
|
||||
declare
|
||||
the initial context item for a template<br></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapsible">
|
||||
<button class="section-button collapseTrigger" style="border: none">Creating result tree</button>
|
||||
<div class="content">
|
||||
[v1.0] <a href="https://www.w3.org/TR/xslt-10/#creating-attributes"
|
||||
target="_blank"><code><xsl:attribute></code></a> - Adds an attribute<br>
|
||||
[v1.0] <a href="https://www.w3.org/TR/xslt-10/#attribute-sets"
|
||||
target="_blank"><code><xsl:attribute-set></code></a> - Defines a named set of
|
||||
attributes<br>
|
||||
[v1.0] <a href="https://www.w3.org/TR/xslt-10/#copying"
|
||||
target="_blank"><code><xsl:copy></code></a> - Creates a copy of the current node
|
||||
(without
|
||||
child nodes and attributes)<br>
|
||||
[v1.0] <a href="https://www.w3.org/TR/xslt-10/#number"
|
||||
target="_blank"><code><xsl:number></code></a> - Determines the integer position of
|
||||
the
|
||||
current node and formats a number<br>
|
||||
[v1.0] <a href="https://www.w3.org/TR/xslt-10/#value-of"
|
||||
target="_blank"><code><xsl:value-of></code></a> - Extracts the value of a selected
|
||||
node<br>
|
||||
[v1.0] <a href="https://www.w3.org/TR/xslt-10/#section-Creating-Text"
|
||||
target="_blank"><code><xsl:text></code></a> - Writes literal text to the output<br>
|
||||
[v1.0] <a href="https://www.w3.org/TR/xslt-10/#section-Creating-Comments"
|
||||
target="_blank"><code><xsl:comment></code></a> - Creates a comment node in the result
|
||||
tree<br>
|
||||
[v1.0] <a href="https://www.w3.org/TR/xslt-10/#section-Creating-Processing-Instructions"
|
||||
target="_blank"><code><xsl:processing-instruction></code></a> - Writes a processing
|
||||
instruction to the output<br>
|
||||
[v1.0] <a href="https://www.w3.org/TR/xslt-10/#key"
|
||||
target="_blank"><code><xsl:key></code></a> -
|
||||
Declares a named key that can be used in the
|
||||
style sheet with the key() function<br>
|
||||
[v1.0] <a href="https://www.w3.org/TR/xslt-10/#format-number"
|
||||
target="_blank"><code><xsl:decimal-format></code></a> - Defines the characters and
|
||||
symbols to be used when converting numbers into strings, with the format-number() function<br>
|
||||
[v1.0] <a href="https://www.w3.org/TR/xslt-10/#strip"
|
||||
target="_blank"><code><xsl:preserve-space></code></a> - Defines the elements for
|
||||
which
|
||||
white space should be preserved<br>
|
||||
[v1.0] <a href="https://www.w3.org/TR/xslt-10/#strip"
|
||||
target="_blank"><code><xsl:strip-space></code></a> - Defines the elements for which
|
||||
white
|
||||
space should be removed<br>
|
||||
[v1.0] <a href="https://www.w3.org/TR/xslt-10/#sorting"
|
||||
target="_blank"><code><xsl:sort></code></a> - Sorts the output<br>
|
||||
[v1.0] <a href="https://www.w3.org/TR/xslt-10/#output"
|
||||
target="_blank"><code><xsl:output></code></a> - Defines the format of the output
|
||||
document<br>
|
||||
<span name="collapse2">[v2.0] <a href="https://www.w3.org/TR/xslt20/#element-perform-sort"
|
||||
target="_blank"><code><xsl:for-each-group></code></a> - Sorts given
|
||||
sequence<br></span>
|
||||
<span name="collapse2">[v2.0] <a href="https://www.w3.org/TR/xslt20/#element-result-document"
|
||||
target="_blank"><code><xsl:result-document></code></a> - Creates a final result
|
||||
tree<br></span>
|
||||
<span name="collapse2">[v2.0] <a href="https://www.w3.org/TR/xslt20/#element-character-map"
|
||||
target="_blank"><code><xsl:character-map></code></a> - Allows a specific
|
||||
character
|
||||
appearing in the final result tree to be substituted by a specified string of
|
||||
characters<br></span>
|
||||
<span name="collapse2">[v2.0] <a href="https://www.w3.org/TR/xslt20/#element-character-map"
|
||||
target="_blank"><code><xsl:output-character></code></a> - Defines characters and
|
||||
their replacements to be used by character-map<br></span>
|
||||
<span name="collapse2">[v3.0] <a href="http://www.w3.org/TR/xslt-30/#element-merge"
|
||||
target="_blank"><code><xsl:merge></code></a> - Merges two or more pre-sorted
|
||||
input
|
||||
files<br></span>
|
||||
<span name="collapse2">[v3.0] <a href="http://www.w3.org/TR/xslt-30/#element-merge-action"
|
||||
target="_blank"><code><xsl:merge-action></code></a> - Defines action to be
|
||||
carried
|
||||
out on each merged group<br></span>
|
||||
<span name="collapse2">[v3.0] <a href="http://www.w3.org/TR/xslt-30/#element-merge-key"
|
||||
target="_blank"><code><xsl:merge-key></code></a> - Used to define the merge keys
|
||||
on
|
||||
which the input sequences are sorted<br></span>
|
||||
<span name="collapse2">[v3.0] <a href="http://www.w3.org/TR/xslt-30/#element-merge-source"
|
||||
target="_blank"><code><xsl:merge-source></code></a> - Describes the input source
|
||||
for
|
||||
an xsl:merge instruction<br></span>
|
||||
<!-- <span name="collapse2">[v3.0] <a href=" " target="_blank"><code>< ></code></a> - <br></span>
|
||||
<span name="collapse2">[v3.0] <a href=" " target="_blank"><code>< ></code></a> - <br></span>
|
||||
<span name="collapse2">[v3.0] <a href=" " target="_blank"><code>< ></code></a> - <br></span> -->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapsible">
|
||||
<button class="section-button collapseTrigger" style="border: none">Stylesheet structure</button>
|
||||
<div class="content">
|
||||
[v1.0] <a href="https://www.w3.org/TR/xslt-10/#stylesheet-element"
|
||||
target="_blank"><code><xsl:stylesheet></code></a> - Defines the root element of a
|
||||
style
|
||||
sheet<br>
|
||||
[v1.0] <a href="https://www.w3.org/TR/xslt-10/#stylesheet-element"
|
||||
target="_blank"><code><xsl:transform></code></a> - Defines the root element of a
|
||||
style
|
||||
sheet<br>
|
||||
[v1.0] <a href="https://www.w3.org/TR/xslt-10/#import"
|
||||
target="_blank"><code><xsl:import></code></a> - Imports the contents of one style
|
||||
sheet
|
||||
into another. Note: An imported style sheet has lower precedence than the importing style
|
||||
sheet<br>
|
||||
[v1.0] <a href="https://www.w3.org/TR/xslt-10/#include"
|
||||
target="_blank"><code><xsl:include></code></a> - Includes the contents of one style
|
||||
sheet
|
||||
into another. Note: An included style sheet has the same precedence as the including style
|
||||
sheet<br>
|
||||
[v1.0] <a href="https://www.w3.org/TR/xslt-10/#literal-result-element"
|
||||
target="_blank"><code><xsl:namespace-alias></code></a> - Replaces a namespace in the
|
||||
style sheet to a different namespace in the output<br>
|
||||
[v1.0] <a href="https://www.w3.org/TR/xslt-10/#section-Creating-Elements-with-xsl:element"
|
||||
target="_blank"><code><xsl:element></code></a> - Creates an element node in the
|
||||
output
|
||||
document<br>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapsible">
|
||||
<button class="section-button collapseTrigger" style="border: none">Variables and
|
||||
Parameters</button>
|
||||
<div class="content">
|
||||
[v1.0] <a href="https://www.w3.org/TR/xslt-10/#variables"
|
||||
target="_blank"><code><xsl:param></code></a> - Declares a local or global
|
||||
parameter<br>
|
||||
[v1.0] <a href="https://www.w3.org/TR/xslt-10/#variables"
|
||||
target="_blank"><code><xsl:variable></code></a> - Declares a local or global
|
||||
variable<br>
|
||||
[v1.0] <a href="https://www.w3.org/TR/xslt-10/#section-Passing-Parameters-to-Templates"
|
||||
target="_blank"><code><xsl:with-param></code></a> - Defines the value of a parameter
|
||||
to
|
||||
be passed into a template<br>
|
||||
[v1.0] <a href="https://www.w3.org/TR/xslt-10/#copy-of"
|
||||
target="_blank"><code><xsl:copy-of></code></a> - Creates a copy of the current node
|
||||
(with
|
||||
child nodes and attributes)<br>
|
||||
<span name="collapse2">[v2.0] <a href="https://www.w3.org/TR/xslt20/#element-document"
|
||||
target="_blank"><code><xsl:document></code></a> - Creates a new document
|
||||
node<br></span>
|
||||
<span name="collapse2">[v2.0] <a href="https://www.w3.org/TR/xslt20/#element-namespace"
|
||||
target="_blank"><code><xsl:namespace></code></a> - Creates a namespace
|
||||
node<br></span>
|
||||
<span name="collapse2">[v2.0] <a href="https://www.w3.org/TR/xslt20/#element-namespace-alias"
|
||||
target="_blank"><code><xsl:namespace-alias></code></a> - Declares that a literal
|
||||
namespace URI is being used as an alias for a target namespace URI<br></span>
|
||||
<span name="collapse2">[v2.0] <a href="https://www.w3.org/TR/xslt20/#element-sequence"
|
||||
target="_blank"><code><xsl:sequence></code></a> - Constructs a sequence of nodes
|
||||
and/or atomic values<br></span>
|
||||
</div>
|
||||
</div>
|
||||
<span name="collapse30">
|
||||
<div class="collapsible">
|
||||
<button class="section-button collapseTrigger" style="border: none" name="collapse2">[v2.0]
|
||||
Regular
|
||||
Expressions</button>
|
||||
<div class="content" name="collapse2data">
|
||||
[v2.0] <a href="https://www.w3.org/TR/xslt20/#element-analyze-string"
|
||||
target="_blank"><code><xsl:analyze-string></code></a> - Identifies substrings
|
||||
that
|
||||
match
|
||||
given regex<br>
|
||||
[v2.0] <a href="https://www.w3.org/TR/xslt20/#element-analyze-string"
|
||||
target="_blank"><code><xsl:matching-substring></code></a> - Used in conjunction
|
||||
with
|
||||
analize-string, returns matching substrings<br>
|
||||
[v2.0] <a href="https://www.w3.org/TR/xslt20/#element-analyze-string"
|
||||
target="_blank"><code><xsl:non-matching-substring></code></a> - Used in
|
||||
conjunction
|
||||
with
|
||||
analize-string, returns substrings that didn't match the regex
|
||||
</div>
|
||||
</div>
|
||||
</span>
|
||||
<span name="collapse30">
|
||||
<div class="collapsible">
|
||||
<button class="section-button collapseTrigger" style="border: none" name="collapse2">[v2.0 -
|
||||
3.0]
|
||||
Callable</button>
|
||||
<div class="content" name="collapse2data">
|
||||
<span name="collapse2">[v2.0] <a href="https://www.w3.org/TR/xslt20/#element-function"
|
||||
target="_blank"><code><xsl:function></code></a> - Declares a function that
|
||||
can be
|
||||
called from any XPath expression in the stylesheet<br></span>
|
||||
<span name="collapse2">[v3.0] <a href="http://www.w3.org/TR/xslt-30/#element-evaluate"
|
||||
target="_blank"><code><xsl:evaluate></code></a> - Allows dynamic evaluation
|
||||
of
|
||||
XPath
|
||||
expressions from a string<br></span>
|
||||
<span name="collapse2">[v3.0] <a href="http://www.w3.org/TR/xslt-30/#element-assert"
|
||||
target="_blank"><code><xsl:assert></code></a> - Asserts a XPath expression,
|
||||
optionally throwing a dynamic error<br></span>
|
||||
<!-- <span name="collapse2">[v3.0] <a href=" " target="_blank"><code>< ></code></a> - <br></span> -->
|
||||
</div>
|
||||
</div>
|
||||
</span>
|
||||
<div class="collapsible">
|
||||
<button class="section-button collapseTrigger" style="border: none" style="border: none">Other
|
||||
elements</button>
|
||||
<div class="content">
|
||||
[v1.0] <a href="https://www.w3.org/TR/xslt-10/#message"
|
||||
target="_blank"><code><xsl:message></code></a> - Writes a message to the output (used
|
||||
to
|
||||
report errors)<br>
|
||||
[v1.0] <a href="https://www.w3.org/TR/xslt-10/#fallback"
|
||||
target="_blank"><code><xsl:fallback></code></a> - Specifies an alternate code to run
|
||||
if
|
||||
the processor does not support an XSLT element<br>
|
||||
<span name="collapse2">[v3.0] <a href="http://www.w3.org/TR/xslt-30/#element-map"
|
||||
target="_blank"><code><xsl:map></code></a> - Used to construct a new
|
||||
map<br></span>
|
||||
<span name="collapse2">[v3.0] <a href="http://www.w3.org/TR/xslt-30/#element-map-entry"
|
||||
target="_blank"><code><xsl:map-entry></code></a> - Used to construct a singleton
|
||||
map
|
||||
(one key and one value)<br></span>
|
||||
|
||||
<span name="collapse2">[v3.0] <a href="http://www.w3.org/TR/xslt-30/#element-expose"
|
||||
target="_blank"><code><xsl:expose></code></a> - Used to modify the visibility of
|
||||
selected components within a package<br></span>
|
||||
<span name="collapse2">[v3.0] <a href="http://www.w3.org/TR/xslt-30/#element-accumulator"
|
||||
target="_blank"><code><xsl:accumulator></code></a> - Defines a rule that is to be
|
||||
applied while the document is being sequentially processed<br></span>
|
||||
<span name="collapse2">[v3.0] <a href="http://www.w3.org/TR/xslt-30/#element-accumulator-rule"
|
||||
target="_blank"><code><xsl:accumulator-rule></code></a> - Defines a rule for an
|
||||
xsl:accumulator<br></span>
|
||||
<span name="collapse2"><b>Streaming: (not usable on this website!)</b></span>
|
||||
<span name="collapse2">[v3.0] <a href="http://www.w3.org/TR/xslt-30/#element-source-document"
|
||||
target="_blank"><code><xsl:source-document></code></a> - Initiates streamed or
|
||||
unstreamed processing of a source document<br></span>
|
||||
<span name="collapse2">[v3.0] <a href="http://www.w3.org/TR/xslt-30/#element-use-package"
|
||||
target="_blank"><code><xsl:use-package></code></a> - <br></span>
|
||||
<span name="collapse2">[v3.0] <a href="http://www.w3.org/TR/xslt-30/#element-where-populated"
|
||||
target="_blank"><code><xsl:where-populated></code></a> - Allows conditional
|
||||
content
|
||||
construction to be made streamable<br></span>
|
||||
<span name="collapse2"><b>Packages: (not usable on this website!)</b></span>
|
||||
<span name="collapse2">[v3.0] <a href="https://www.w3.org/TR/xslt-30/#element-accept"
|
||||
target="_blank"><code><xsl:accept></code></a> - Allows a package to restrict the
|
||||
visibility of components exposed by a package that it uses<br></span>
|
||||
<!-- <span name="collapse2">[v3.0] <a href=" " target="_blank"><code>< ></code></a> - <br></span> -->
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</span>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- <script>
|
||||
function getVersion() {
|
||||
return document.getElementById("versions").value;
|
||||
}
|
||||
</script> -->
|
||||
<script>
|
||||
function processTooltip() {
|
||||
console.log("processTooltip");
|
||||
|
||||
|
||||
if (getProcInfo() == "xalan") {
|
||||
document.getElementById("tooltipFunctionInfo").innerText = "XSLT 1.0 functions";
|
||||
document.getElementById("processorTooltipInfo").innerText = "Supports XSLT 1.0";
|
||||
hideList(document.getElementsByName("collapse30"));
|
||||
} else {
|
||||
document.getElementById("tooltipFunctionInfo").innerText = "XSLT 1.0, 2.0 & 3.0 functions";
|
||||
document.getElementById("processorTooltipInfo").innerText = "Supports XSLT up to 3.0";
|
||||
showList(document.getElementsByName("collapse30"));
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
function getProcessor() {
|
||||
return document.getElementById("processors").value;
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
function getVersion() {
|
||||
if (getProcInfo() == "xalan") {
|
||||
return "1.0";
|
||||
} else {
|
||||
return "3.0";
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
function getProcInfo() {
|
||||
var processVariables = document.getElementById("processors").value;// + "&version=" + document.getElementById("versions").value;
|
||||
return processVariables;
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
var triggerList = document.getElementsByClassName("collapseTrigger");
|
||||
for (i = 0; i < triggerList.length; i++) {
|
||||
console.log("trigger connected");
|
||||
triggerList[i].addEventListener("click", function () {
|
||||
console.log("click");
|
||||
var collapsible = this.parentElement;
|
||||
var collapsibleData = this.nextElementSibling;
|
||||
if (collapsibleData.style.maxHeight > "0px") {
|
||||
collapsibleData.style.maxHeight = "0px";
|
||||
|
||||
this.classList.toggle("active", false);
|
||||
if (!this.classList.contains("collapsibleMini")) {
|
||||
collapsible.classList.toggle("active", false);
|
||||
}
|
||||
|
||||
var subLists1 = collapsibleData.getElementsByClassName("content");
|
||||
var subLists2 = collapsibleData.getElementsByClassName("active");
|
||||
for (j = 0; j < subLists1.length; j++) {
|
||||
subLists1[j].style.maxHeight = "0px";
|
||||
}
|
||||
for (j = 0; j < subLists2.length; j++) {
|
||||
subLists2[j].classList.toggle("active", false);
|
||||
}
|
||||
} else {
|
||||
collapsibleData.style.maxHeight = (collapsibleData.scrollHeight) + "px";
|
||||
|
||||
this.classList.toggle("active", true);
|
||||
if (!this.classList.contains("collapsibleMini")) {
|
||||
collapsible.classList.toggle("active", true);
|
||||
} else {
|
||||
var parentContent = this.closest(".content");
|
||||
parentContent.style.maxHeight = (parentContent.scrollHeight + collapsibleData.scrollHeight) + "px";
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
function init() {
|
||||
//Handle clicks in whole form and set info in tooltip
|
||||
setDefaultContent(document.getElementById("xmlArea"), 'Insert XML here');
|
||||
setDefaultContent(document.getElementById("transformArea"), 'Insert XSLT here');
|
||||
console.log("init");
|
||||
// refreshTooltip();
|
||||
processTooltip();
|
||||
tool.addEventListener('click', event => {
|
||||
//Check if script was called from textarea or selector
|
||||
var targetID = event.target.getAttribute('id');
|
||||
if (targetID !== "processors" && targetID !== "xmlArea" && targetID !== "transformArea" && targetID !== "versions") {
|
||||
return;
|
||||
}
|
||||
|
||||
processTooltip();
|
||||
// console.log("clock");
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
1227
Homepage/Frontend/xslt.html
Normal file
1227
Homepage/Frontend/xslt.html
Normal file
File diff suppressed because it is too large
Load Diff
101
Homepage/common.css
Normal file
101
Homepage/common.css
Normal file
@@ -0,0 +1,101 @@
|
||||
/* TODO Ogarnac czcionke!! */
|
||||
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@200&display=swap');
|
||||
|
||||
body {
|
||||
font-family: 'Nunito', sans-serif;
|
||||
color: #2e3133;
|
||||
font-weight: normal;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
textarea:focus {
|
||||
box-shadow: 0 0 5px rgba(81, 203, 238);
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.tooltip{
|
||||
border: 2px solid rgba(155, 165, 160, 0.507);
|
||||
border-radius: 15px;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
a, a:visited, a:active {
|
||||
color: rgb(47, 125, 146);
|
||||
}
|
||||
|
||||
a:hover{
|
||||
filter: brightness(120%);
|
||||
}
|
||||
|
||||
.field {
|
||||
border: 2px solid rgba(56, 59, 58, 0.507);
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
button {
|
||||
font-size: 20px;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
border: none;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
input {
|
||||
border-radius: 5px;
|
||||
border: 1px solid rgba(155, 165, 160, 0.507);
|
||||
}
|
||||
|
||||
button:hover{
|
||||
filter: brightness(110%);
|
||||
/* TODO Insert animation here! */
|
||||
}
|
||||
|
||||
.tooltip h1{
|
||||
margin: 0px;
|
||||
font-size: 24px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.tooltip button{
|
||||
background-color: rgba(155, 165, 160, 0.507);
|
||||
color: rgb(44, 44, 44);
|
||||
border-bottom: 2px solid rgba(99, 99, 99, 0.507);
|
||||
padding: 14px;
|
||||
}
|
||||
|
||||
.btn-action {
|
||||
background-color: #3bc4f1;
|
||||
color: white;
|
||||
padding: 15px 32px;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.versionInfo {
|
||||
color: rgba(85, 85, 85, 0.555);
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.resizeVertical {
|
||||
resize: vertical;
|
||||
}
|
||||
|
||||
.resizeNone {
|
||||
resize: none;
|
||||
}
|
||||
|
||||
table{
|
||||
border: none;
|
||||
}
|
||||
|
||||
.collapsibleData {
|
||||
padding: 0 18px;
|
||||
/* max-height: 0; */
|
||||
overflow: hidden;
|
||||
/* transition: height 0.2s ease-out; */
|
||||
/* transition: max-height 0.2s ease-out; */
|
||||
background-color: #f1f1f1;
|
||||
}
|
||||
|
||||
.textField-key{
|
||||
background-color: #e6e6e6;
|
||||
}
|
||||
BIN
Homepage/favicon.ico
Normal file
BIN
Homepage/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.4 KiB |
35
Homepage/index.html
Normal file
35
Homepage/index.html
Normal file
@@ -0,0 +1,35 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<link rel="stylesheet" href="styles.css">
|
||||
<!-- <link rel="stylesheet" href="common.css"> -->
|
||||
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="header">
|
||||
<h1 id="logo"><a href="http://release11.com/"><img src="./logo.png" alt="Release11"></a></h1>
|
||||
</div>
|
||||
|
||||
<div id="content">
|
||||
<div id="toolList">
|
||||
<ul id="toolList">
|
||||
<li id="toolListRow"><a href="http://gordon.zipper.release11.com:8097/" target="iframe">REST Mock</a></li>
|
||||
<li id="toolListRow"><a href="./Frontend/xpath.html" target="iframe">XPath</a></li>
|
||||
<li id="toolListRow"><a href="./Frontend/xslt.html" target="iframe">XSLT</a></li>
|
||||
<li id="toolListRow"><a href="http://gordon.zipper.release11.com:8071/jpk-converter/" target="iframe">JPK</a></li>
|
||||
<li id="toolListRow"><a href="./tool1.html" target="iframe">Tool 5</a></li>
|
||||
<li id="toolListRow"><a href="./tool1.html" target="iframe">Tool 6</a></li>
|
||||
<li id="toolListRow"><a href="./tool1.html" target="iframe">Tool 7</a></li>
|
||||
<li id="toolListRow"><a href="./tool1.html" target="iframe">Tool 8</a></li>
|
||||
</ul>
|
||||
<div id="copyright">Copyright © 2021<br><a href="http://release11.com/">release11 Sp. z o. o.</a></div>
|
||||
</div>
|
||||
<iframe id="frame" name="iframe" src="http://gordon.zipper.release11.com:8097/" frameborder="0"></iframe>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
BIN
Homepage/logo.png
Normal file
BIN
Homepage/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.7 KiB |
87
Homepage/styles.css
Normal file
87
Homepage/styles.css
Normal file
@@ -0,0 +1,87 @@
|
||||
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@200&display=swap');
|
||||
|
||||
body {
|
||||
font-family: 'Nunito', sans-serif;
|
||||
color: #2e3133;
|
||||
font-weight: normal;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
html,
|
||||
body {
|
||||
height: 100%;
|
||||
min-height: 100%;
|
||||
}
|
||||
|
||||
div#header {
|
||||
background-color: rgb(85, 85, 85);
|
||||
width: 100%;
|
||||
height: 80px;
|
||||
}
|
||||
|
||||
#logo {
|
||||
padding: 20px 20px 20px;
|
||||
}
|
||||
|
||||
iframe#frame {
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
div#content {
|
||||
width: 100%;
|
||||
height: calc(100% - 80px);
|
||||
display: flex;
|
||||
}
|
||||
|
||||
div#toolList {
|
||||
float: left;
|
||||
width: 200px;
|
||||
background-color: rgb(85, 85, 85);
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
li{
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
div#copyright{
|
||||
color:rgb(192, 192, 192);
|
||||
position: fixed;
|
||||
bottom: 10px;
|
||||
width: 200px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
div#copyright a, a:visited, a:active {
|
||||
color: rgb(192, 192, 192);
|
||||
}
|
||||
|
||||
ul#toolList {
|
||||
list-style-type: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
display: block;
|
||||
float: left;
|
||||
background-color: rgb(85, 85, 85);
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#toolListRow a {
|
||||
display: block;
|
||||
color: white;
|
||||
text-align: center;
|
||||
padding: 20px 50px 25px;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
#toolListRow a:hover {
|
||||
background-color: #111111;
|
||||
transition-duration: .3s;
|
||||
}
|
||||
11
Jenkinsfile
vendored
Normal file
11
Jenkinsfile
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
node('master'){
|
||||
stage('git pull'){
|
||||
git credentialsId: '7724c11a-2509-4aa3-9862-106aa354c5b8', url: 'ssh://_git@phabricator.release11.com/diffusion/CZOPW/czopw.git'
|
||||
}
|
||||
stage('build & deploy'){
|
||||
sh 'cd Web/ && docker-compose --context gordon up --force-recreate --build -d'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
21
REST_XSLT/Dockerfile
Normal file
21
REST_XSLT/Dockerfile
Normal file
@@ -0,0 +1,21 @@
|
||||
# Using maven image, based on java 8
|
||||
FROM maven:3.6.3-jdk-8 as target
|
||||
WORKDIR /build
|
||||
COPY pom.xml .
|
||||
COPY src/ /build/src/
|
||||
RUN mvn -ntp package
|
||||
|
||||
# Go to working directory in docker image
|
||||
# WORKDIR /usr/app/
|
||||
|
||||
FROM openjdk:slim-buster
|
||||
COPY --from=target /build/target/*jar-with-dependencies.jar /app/REST_XSLT.jar
|
||||
|
||||
# Download dependencies during image build
|
||||
# (RUN - works on image creation)
|
||||
# (CMD - works on container start)
|
||||
# RUN mvn dependency:resolve
|
||||
# RUN mvn dependency:go-offline
|
||||
|
||||
# On container creation - run maven tests
|
||||
CMD exec java -jar /app/REST_XSLT.jar
|
||||
134
REST_XSLT/pom.xml
Normal file
134
REST_XSLT/pom.xml
Normal file
@@ -0,0 +1,134 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>r11.mltx</groupId>
|
||||
<artifactId>REST_XSLT</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>11</maven.compiler.source>
|
||||
<maven.compiler.target>11</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<!-- <plugin>-->
|
||||
<!-- <artifactId>maven-jar-plugin</artifactId>-->
|
||||
<!-- <version>3.1.0</version>-->
|
||||
<!-- <configuration>-->
|
||||
<!-- <archive>-->
|
||||
<!-- <manifest>-->
|
||||
<!-- <addClasspath>true</addClasspath>-->
|
||||
<!-- <classpathPrefix>lib/</classpathPrefix>-->
|
||||
<!-- <mainClass>Main</mainClass>-->
|
||||
<!-- </manifest>-->
|
||||
<!-- </archive>-->
|
||||
<!-- </configuration>-->
|
||||
<!-- </plugin>-->
|
||||
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<version>3.3.0</version>
|
||||
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifest>
|
||||
<addClasspath>true</addClasspath>
|
||||
<classpathPrefix>lib/</classpathPrefix>
|
||||
<mainClass>Main</mainClass>
|
||||
</manifest>
|
||||
</archive>
|
||||
<descriptorRefs>
|
||||
<descriptorRef>jar-with-dependencies</descriptorRef>
|
||||
</descriptorRefs>
|
||||
</configuration>
|
||||
|
||||
<executions>
|
||||
<execution>
|
||||
<id>make-assembly</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
||||
</build>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-core</artifactId>
|
||||
<version>2.11.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
<version>2.11.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.sparkjava</groupId>
|
||||
<artifactId>spark-core</artifactId>
|
||||
<version>2.9.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-simple</artifactId>
|
||||
<version>1.6.2</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<!-- XSLT -->
|
||||
<dependency>
|
||||
<groupId>net.sf.saxon</groupId>
|
||||
<artifactId>Saxon-HE</artifactId>
|
||||
<version>10.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>xalan</groupId>
|
||||
<artifactId>xalan</artifactId>
|
||||
<version>2.7.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>jcl-over-slf4j</artifactId>
|
||||
<version>1.7.0</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
<version>1.7.0</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-log4j12</artifactId>
|
||||
<version>1.7.0</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>log4j</groupId>
|
||||
<artifactId>log4j</artifactId>
|
||||
<version>1.2.14</version>
|
||||
</dependency>
|
||||
<!-- JSON -->
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
220
REST_XSLT/src/main/java/Main.java
Normal file
220
REST_XSLT/src/main/java/Main.java
Normal file
@@ -0,0 +1,220 @@
|
||||
import com.fasterxml.jackson.databind.JsonMappingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import processors.Saxon;
|
||||
import processors.Xalan;
|
||||
import spark.*;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
Spark.port(8081);
|
||||
|
||||
Spark.after((Filter) (request, response) -> {
|
||||
response.header("Access-Control-Allow-Origin", "*");
|
||||
response.header("access-control-allow-headers", "*");
|
||||
response.header("access-control-expose-headers", "*");
|
||||
response.header("Access-Control-Allow-Methods", "POST");
|
||||
});
|
||||
|
||||
Spark.post("/xsltpost", xsltHandler);
|
||||
Spark.post("/xpathpost", xpathHandler);
|
||||
Spark.post("/xsdpost", xsdHandler);
|
||||
Spark.get("/procinfo", procinfoHandler);
|
||||
System.out.println("Server is online");
|
||||
}
|
||||
|
||||
static Route procinfoHandler = (Request req, Response resp) -> {
|
||||
try {
|
||||
// req.session().id
|
||||
resp.header("processor", "Saxon " + Saxon.getVersion() + " over s9api");
|
||||
return Saxon.getVersion();
|
||||
} catch (Exception ex) {
|
||||
return ex.getMessage();
|
||||
}
|
||||
};
|
||||
|
||||
static Route xsdHandler = (Request req, Response resp) -> {
|
||||
String body = req.body();
|
||||
System.out.println("Request: " + body);
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
Map<String, String> requestMap = null;
|
||||
Map<String, String> responseMap = new HashMap<>();
|
||||
try {
|
||||
requestMap = mapper.readValue(body, Map.class);
|
||||
} catch (JsonMappingException ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
||||
String data = requestMap.get("data");
|
||||
String xsd = requestMap.get("process");
|
||||
String processor = requestMap.get("processor");
|
||||
String version = requestMap.get("version");
|
||||
|
||||
resp.header("processor", Xalan.getVersion());
|
||||
long timeStart = System.currentTimeMillis();
|
||||
String tmp = "";
|
||||
try {
|
||||
tmp = Xalan.validate(data, xsd).trim();
|
||||
responseMap.put("result", tmp);
|
||||
responseMap.put("status", "OK");
|
||||
} catch (Exception ex) {
|
||||
System.out.println("Exception: "+ex.getMessage());
|
||||
responseMap.put("result", ex.getMessage());
|
||||
responseMap.put("status", "ERR");
|
||||
resp.status(400);
|
||||
}
|
||||
long duration = System.currentTimeMillis() - timeStart;
|
||||
responseMap.put("processor", Xalan.getVersion());
|
||||
responseMap.put("time", "" + duration);
|
||||
resp.body(mapper.writeValueAsString(responseMap));
|
||||
return resp;
|
||||
};
|
||||
|
||||
static Route xpathHandler = (Request req, Response resp) -> {
|
||||
|
||||
String body = req.body();
|
||||
System.out.println("Request: " + body);
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
Map<String, String> requestMap = null;
|
||||
Map<String, String> responseMap = new HashMap<>();
|
||||
try {
|
||||
requestMap = mapper.readValue(body, Map.class);
|
||||
} catch (JsonMappingException ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
||||
String data = requestMap.get("data");
|
||||
String query = requestMap.get("process");
|
||||
String processor = requestMap.get("processor");
|
||||
String version = requestMap.get("version");
|
||||
|
||||
String tmp = "";
|
||||
long timeStart = 0;
|
||||
long duration = 0;
|
||||
|
||||
if (processor == null) {
|
||||
return "saxon, xalan";
|
||||
}
|
||||
try {
|
||||
switch (processor) {
|
||||
case "saxon":
|
||||
resp.header("processor", "Saxon " + Saxon.getVersion() + " " + version + " over s9api");
|
||||
System.out.print("Processing start...");
|
||||
timeStart = System.currentTimeMillis();
|
||||
try {
|
||||
tmp = Saxon.processXPath(data, query, version).trim();
|
||||
responseMap.put("result", tmp);
|
||||
responseMap.put("status", "OK");
|
||||
} catch (Exception ex) {
|
||||
responseMap.put("result", ex.getMessage());
|
||||
responseMap.put("status", "ERR");
|
||||
resp.status(400);
|
||||
}
|
||||
duration = System.currentTimeMillis() - timeStart;
|
||||
System.out.println("end(" + duration + ")");
|
||||
responseMap.put("processor", "Saxon " + Saxon.getVersion() + " " + version + " over s9api");
|
||||
responseMap.put("time", "" + duration);
|
||||
resp.body(mapper.writeValueAsString(responseMap));
|
||||
return resp;
|
||||
|
||||
case "xalan":
|
||||
resp.header("processor", Xalan.getVersion());
|
||||
timeStart = System.currentTimeMillis();
|
||||
try {
|
||||
tmp = Xalan.processXPath(data, query).trim();
|
||||
responseMap.put("result", tmp);
|
||||
responseMap.put("status", "OK");
|
||||
} catch (Exception ex) {
|
||||
responseMap.put("result", ex.getMessage());
|
||||
responseMap.put("status", "ERR");
|
||||
resp.status(400);
|
||||
}
|
||||
duration = System.currentTimeMillis() - timeStart;
|
||||
responseMap.put("processor", Xalan.getVersion());
|
||||
responseMap.put("result", tmp);
|
||||
responseMap.put("time", "" + duration);
|
||||
resp.body(mapper.writeValueAsString(responseMap));
|
||||
return resp;
|
||||
|
||||
default:
|
||||
return "saxon, xalan";
|
||||
}
|
||||
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
return ex.getMessage();
|
||||
}
|
||||
};
|
||||
|
||||
static Route xsltHandler = (Request req, Response resp) -> {
|
||||
String body = req.body();
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
Map<String, String> jsonMap = null;
|
||||
Map<String, String> responseMap = new HashMap<>();
|
||||
try {
|
||||
jsonMap = mapper.readValue(body, Map.class);
|
||||
System.out.println(jsonMap);
|
||||
} catch (JsonMappingException ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
String data = jsonMap.get("data");
|
||||
String query = jsonMap.get("process");
|
||||
String processor = jsonMap.get("processor");
|
||||
String version = jsonMap.get("version");
|
||||
|
||||
if (processor == null) {
|
||||
return "saxon, xalan";
|
||||
}
|
||||
try {
|
||||
String tmp = "";
|
||||
long timeStart = 0;
|
||||
long duration = 0;
|
||||
switch (processor) {
|
||||
case "saxon":
|
||||
// resp.header("processor", "Saxon " + Saxon.getVersion());
|
||||
timeStart = System.currentTimeMillis();
|
||||
try {
|
||||
tmp = Saxon.processXSLT(data, query);
|
||||
responseMap.put("result", tmp);
|
||||
responseMap.put("status", "OK");
|
||||
} catch (Exception ex) {
|
||||
responseMap.put("result", ex.getMessage());
|
||||
responseMap.put("status", "ERR");
|
||||
resp.status(400);
|
||||
}
|
||||
|
||||
|
||||
duration = System.currentTimeMillis() - timeStart;
|
||||
responseMap.put("processor", "Saxon " + Saxon.getVersion() + " " + version);
|
||||
responseMap.put("time", "" + duration);
|
||||
resp.body(mapper.writeValueAsString(responseMap));
|
||||
return resp;
|
||||
|
||||
case "xalan":
|
||||
timeStart = System.currentTimeMillis();
|
||||
try {
|
||||
tmp = Xalan.processXSLT(data, query);
|
||||
responseMap.put("result", tmp);
|
||||
responseMap.put("status", "OK");
|
||||
} catch (Exception ex) {
|
||||
responseMap.put("result", ex.getMessage());
|
||||
responseMap.put("status", "ERR");
|
||||
resp.status(400);
|
||||
}
|
||||
duration = System.currentTimeMillis() - timeStart;
|
||||
responseMap.put("processor", Xalan.getVersion());
|
||||
responseMap.put("time", "" + duration);
|
||||
resp.body(mapper.writeValueAsString(responseMap));
|
||||
return resp;
|
||||
|
||||
default:
|
||||
return "saxon, xalan";
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
return ex.getMessage();
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
54
REST_XSLT/src/main/java/processors/NewNamespaceResolver.java
Normal file
54
REST_XSLT/src/main/java/processors/NewNamespaceResolver.java
Normal file
@@ -0,0 +1,54 @@
|
||||
package processors;
|
||||
|
||||
import net.sf.saxon.om.NamespaceBinding;
|
||||
import net.sf.saxon.om.NamespaceMap;
|
||||
import net.sf.saxon.s9api.XPathCompiler;
|
||||
import net.sf.saxon.s9api.XdmNode;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
public class NewNamespaceResolver {
|
||||
|
||||
private NamespaceMap namespaceMap;
|
||||
|
||||
public NamespaceMap process(XdmNode doc) {
|
||||
namespaceMap = NamespaceMap.emptyMap();
|
||||
Iterator<XdmNode> it = doc.children().iterator();
|
||||
|
||||
while (it.hasNext()) {
|
||||
XdmNode tmp = it.next();
|
||||
extractNamespace(tmp);
|
||||
}
|
||||
return namespaceMap;
|
||||
}
|
||||
|
||||
public void exportNamespaces(XPathCompiler compiler){
|
||||
Iterator<NamespaceBinding> it = namespaceMap.iterator();
|
||||
while(it.hasNext()){
|
||||
System.out.println(it.next());
|
||||
}
|
||||
namespaceMap.forEach(namespaceBinding -> compiler.declareNamespace(namespaceBinding.getPrefix(), namespaceBinding.getURI()));
|
||||
}
|
||||
|
||||
private void extractNamespace(XdmNode node) {
|
||||
NamespaceMap tmp;
|
||||
if ((tmp = node.getUnderlyingNode().getAllNamespaces()) != null) {
|
||||
namespaceMap = namespaceMap.putAll(tmp);
|
||||
}
|
||||
if (node.children().iterator().hasNext()) {
|
||||
|
||||
Iterator<XdmNode> it = node.children().iterator();
|
||||
while (it.hasNext()) {
|
||||
XdmNode rNode = it.next();
|
||||
if(rNode.getUnderlyingNode().getPrefix().isEmpty() && !rNode.getParent().getUnderlyingNode().getPrefix().isEmpty()){
|
||||
|
||||
System.out.println("prefix missing, parent has "+rNode.getParent().getUnderlyingNode().getPrefix() + ", but child has none");
|
||||
|
||||
NamespaceMap nsTMP= rNode.getUnderlyingNode().getAllNamespaces();
|
||||
System.out.println();
|
||||
}
|
||||
extractNamespace(rNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
53
REST_XSLT/src/main/java/processors/Saxon.java
Normal file
53
REST_XSLT/src/main/java/processors/Saxon.java
Normal file
@@ -0,0 +1,53 @@
|
||||
package processors;
|
||||
|
||||
import net.sf.saxon.om.NamespaceMap;
|
||||
import net.sf.saxon.s9api.*;
|
||||
import javax.xml.transform.stream.StreamSource;
|
||||
import java.io.StringReader;
|
||||
import java.io.StringWriter;
|
||||
|
||||
public class Saxon {
|
||||
public static String processXSLT(String data, String transform) throws SaxonApiException {
|
||||
Processor processor = new Processor(false);
|
||||
XsltCompiler compiler = processor.newXsltCompiler();
|
||||
XsltExecutable stylesheet = compiler.compile(new StreamSource(new StringReader(transform)));
|
||||
StringWriter sw = new StringWriter();
|
||||
Serializer out = processor.newSerializer(sw);
|
||||
out.setOutputProperty(Serializer.Property.METHOD, "xml");
|
||||
out.setOutputProperty(Serializer.Property.INDENT, "yes");
|
||||
|
||||
Xslt30Transformer transformer = stylesheet.load30();
|
||||
transformer.transform(new StreamSource(new StringReader(data)), out);
|
||||
return sw.toString();
|
||||
}
|
||||
|
||||
public static String processXPath(String data, String query, String version) throws Exception {
|
||||
Processor p = new Processor(false);
|
||||
XPathCompiler compiler = p.newXPathCompiler();
|
||||
DocumentBuilder builder = p.newDocumentBuilder();
|
||||
XdmNode doc = builder.build(new StreamSource(new StringReader(data)));
|
||||
|
||||
// System.out.println(version);
|
||||
|
||||
compiler.setLanguageVersion(version);
|
||||
|
||||
NewNamespaceResolver resolver = new NewNamespaceResolver();
|
||||
|
||||
NamespaceMap nsMa = resolver.process(doc);
|
||||
|
||||
resolver.exportNamespaces(compiler);
|
||||
|
||||
XdmValue result = compiler.evaluate(query, doc);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (XdmItem xdmItem : result) {
|
||||
sb.append(xdmItem);
|
||||
sb.append('\n');
|
||||
}
|
||||
return sb.toString();
|
||||
|
||||
}
|
||||
|
||||
public static String getVersion() {
|
||||
return new Processor(false).getSaxonProductVersion();
|
||||
}
|
||||
}
|
||||
91
REST_XSLT/src/main/java/processors/Xalan.java
Normal file
91
REST_XSLT/src/main/java/processors/Xalan.java
Normal file
@@ -0,0 +1,91 @@
|
||||
package processors;
|
||||
|
||||
import org.apache.xpath.domapi.XPathEvaluatorImpl;
|
||||
import org.w3c.dom.Document;
|
||||
|
||||
import javax.xml.XMLConstants;
|
||||
import javax.xml.namespace.NamespaceContext;
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
import javax.xml.parsers.DocumentBuilderFactory;
|
||||
import javax.xml.transform.*;
|
||||
import javax.xml.transform.dom.DOMSource;
|
||||
import javax.xml.transform.stream.StreamResult;
|
||||
import javax.xml.transform.stream.StreamSource;
|
||||
import javax.xml.validation.Schema;
|
||||
import javax.xml.validation.SchemaFactory;
|
||||
import javax.xml.validation.Validator;
|
||||
import javax.xml.xpath.XPath;
|
||||
import javax.xml.xpath.XPathConstants;
|
||||
import javax.xml.xpath.XPathExpression;
|
||||
import javax.xml.xpath.XPathFactory;
|
||||
import java.io.IOException;
|
||||
import java.io.StringReader;
|
||||
import java.io.StringWriter;
|
||||
import org.w3c.dom.NodeList;
|
||||
import org.xml.sax.InputSource;
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
public class Xalan {
|
||||
|
||||
public static String processXSLT(String data, String transform) throws Exception{
|
||||
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
|
||||
DocumentBuilder builder = factory.newDocumentBuilder();
|
||||
Document document = builder.parse(new InputSource(new StringReader(data)));
|
||||
|
||||
|
||||
|
||||
StreamSource stylesource = new StreamSource(new StringReader(transform));
|
||||
|
||||
|
||||
|
||||
Transformer transformer = TransformerFactory.newInstance().newTransformer(stylesource);
|
||||
transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
|
||||
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
|
||||
Source source = new DOMSource(document);
|
||||
StringWriter sw = new StringWriter();
|
||||
Result outputTarget = new StreamResult(sw);
|
||||
transformer.transform(source, outputTarget);
|
||||
|
||||
return sw.toString();
|
||||
}
|
||||
|
||||
public static String processXPath(String data, String transform) throws Exception{
|
||||
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
|
||||
DocumentBuilder builder = factory.newDocumentBuilder();
|
||||
|
||||
XPath xpath = XPathFactory.newInstance().newXPath();
|
||||
|
||||
xpath.setNamespaceContext(new XalanNamespaceResolver(builder.parse(new InputSource(new StringReader(data))), true));
|
||||
XPathExpression exp = xpath.compile(transform);
|
||||
NodeList nodeList = (NodeList) exp.evaluate(new InputSource(new StringReader(data)), XPathConstants.NODESET);
|
||||
String result = exp.evaluate(new InputSource(new StringReader(data)));
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
public static String getVersion(){
|
||||
return org.apache.xalan.Version.getVersion();
|
||||
}
|
||||
|
||||
public static String validate(String data, String xsd) throws Exception{
|
||||
|
||||
|
||||
Source dataSource = new StreamSource(new StringReader(data));
|
||||
Source xsdSource = new StreamSource(new StringReader(xsd));
|
||||
SchemaFactory schemaFactory = SchemaFactory
|
||||
.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
|
||||
// try {
|
||||
Schema schema = schemaFactory.newSchema(xsdSource);
|
||||
Validator validator = schema.newValidator();
|
||||
validator.validate(dataSource);
|
||||
// System.out.println(dataSource.getSystemId() + " is valid");
|
||||
return "XML file is valid";
|
||||
// } catch (SAXException e) {
|
||||
// System.out.println("Invalid: "+e.getMessage());
|
||||
// return "XML file is NOT valid: " + e.getMessage();
|
||||
//// System.out.println(dataSource.getSystemId() + " is NOT valid reason:" + e);
|
||||
// } catch (IOException e) {
|
||||
// return "IO error: "+e.getMessage();
|
||||
// }
|
||||
}
|
||||
}
|
||||
121
REST_XSLT/src/main/java/processors/XalanNamespaceResolver.java
Normal file
121
REST_XSLT/src/main/java/processors/XalanNamespaceResolver.java
Normal file
@@ -0,0 +1,121 @@
|
||||
package processors;
|
||||
|
||||
import org.w3c.dom.*;
|
||||
|
||||
import javax.xml.XMLConstants;
|
||||
import javax.xml.namespace.NamespaceContext;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
public class XalanNamespaceResolver implements NamespaceContext {
|
||||
private static final String DEFAULT_NS = "DEFAULT";
|
||||
private Map<String, String> prefix2Uri = new HashMap<String, String>();
|
||||
private Map<String, String> uri2Prefix = new HashMap<String, String>();
|
||||
|
||||
/**
|
||||
* This constructor parses the document and stores all namespaces it can
|
||||
* find. If toplevelOnly is true, only namespaces in the root are used.
|
||||
*
|
||||
* @param document
|
||||
* source document
|
||||
* @param toplevelOnly
|
||||
* restriction of the search to enhance performance
|
||||
*/
|
||||
public XalanNamespaceResolver(Document document, boolean toplevelOnly) {
|
||||
examineNode(document.getFirstChild(), toplevelOnly);
|
||||
System.out.println("The list of the cached namespaces:");
|
||||
for (String key : prefix2Uri.keySet()) {
|
||||
System.out.println("prefix " + key + ": uri " + prefix2Uri.get(key));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A single node is read, the namespace attributes are extracted and stored.
|
||||
*
|
||||
* @param node
|
||||
* to examine
|
||||
* @param attributesOnly,
|
||||
* if true no recursion happens
|
||||
*/
|
||||
private void examineNode(Node node, boolean attributesOnly) {
|
||||
NamedNodeMap attributes = node.getAttributes();
|
||||
for (int i = 0; i < attributes.getLength(); i++) {
|
||||
Node attribute = attributes.item(i);
|
||||
storeAttribute((Attr) attribute);
|
||||
}
|
||||
|
||||
if (!attributesOnly) {
|
||||
NodeList chields = node.getChildNodes();
|
||||
for (int i = 0; i < chields.getLength(); i++) {
|
||||
Node chield = chields.item(i);
|
||||
if (chield.getNodeType() == Node.ELEMENT_NODE){
|
||||
examineNode(chield, false);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This method looks at an attribute and stores it, if it is a namespace
|
||||
* attribute.
|
||||
*
|
||||
* @param attribute
|
||||
* to examine
|
||||
*/
|
||||
private void storeAttribute(Attr attribute) {
|
||||
// examine the attributes in namespace xmlns
|
||||
String uri = attribute.getNamespaceURI();
|
||||
String name = attribute.getLocalName();
|
||||
String name2 = attribute.getName();
|
||||
String value = attribute.getNodeValue();
|
||||
if (attribute.getNodeValue() != null
|
||||
/*&& attribute.getNamespaceURI().equals(
|
||||
XMLConstants.XMLNS_ATTRIBUTE_NS_URI)*/) {
|
||||
// Default namespace xmlns="uri goes here"
|
||||
if (attribute.getNodeName().equals(XMLConstants.XMLNS_ATTRIBUTE)) {
|
||||
putInCache(DEFAULT_NS, attribute.getNodeValue());
|
||||
} else {
|
||||
// The defined prefixes are stored here
|
||||
putInCache(attribute.getName().replace("xmlns:", ""), attribute.getNodeValue());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void putInCache(String prefix, String uri) {
|
||||
prefix2Uri.put(prefix, uri);
|
||||
uri2Prefix.put(uri, prefix);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is called by XPath. It returns the default namespace, if the
|
||||
* prefix is null or "".
|
||||
*
|
||||
* @param prefix
|
||||
* to search for
|
||||
* @return uri
|
||||
*/
|
||||
public String getNamespaceURI(String prefix) {
|
||||
if (prefix == null || prefix.equals(XMLConstants.DEFAULT_NS_PREFIX)) {
|
||||
return prefix2Uri.get(DEFAULT_NS);
|
||||
} else {
|
||||
return prefix2Uri.get(prefix);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is not needed in this context, but can be implemented in a
|
||||
* similar way.
|
||||
*/
|
||||
public String getPrefix(String namespaceURI) {
|
||||
return uri2Prefix.get(namespaceURI);
|
||||
}
|
||||
|
||||
public Iterator getPrefixes(String namespaceURI) {
|
||||
// Not implemented
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
9
REST_XSLT/src/main/resources/log4j.properties
Normal file
9
REST_XSLT/src/main/resources/log4j.properties
Normal file
@@ -0,0 +1,9 @@
|
||||
# Set root logger level to DEBUG and its only appender to A1.
|
||||
log4j.rootLogger=ERROR, A1
|
||||
|
||||
# A1 is set to be a ConsoleAppender.
|
||||
log4j.appender.A1=org.apache.log4j.ConsoleAppender
|
||||
|
||||
# A1 uses PatternLayout.
|
||||
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
|
||||
log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
|
||||
105
SampleData/book.xml
Normal file
105
SampleData/book.xml
Normal file
@@ -0,0 +1,105 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<books>
|
||||
<book id="1">
|
||||
<name>Hamlet</name>
|
||||
<date>2001-05-04</date>
|
||||
<authorId>1</authorId>
|
||||
<availability>false</availability>
|
||||
</book>
|
||||
<book id="2">
|
||||
<name>Macbeth</name>
|
||||
<date>2000-12-13</date>
|
||||
<authorId>1</authorId>
|
||||
<availability>false</availability>
|
||||
</book>
|
||||
<book id="3">
|
||||
<name>Harry Potter and the Sorcerer's Stone</name>
|
||||
<date>2005-04-29</date>
|
||||
<authorId>2</authorId>
|
||||
<availability>true</availability>
|
||||
</book>
|
||||
<book id="4">
|
||||
<name>The Long Walk</name>
|
||||
<date>2018-07-01</date>
|
||||
<authorId>4</authorId>
|
||||
<availability>true</availability>
|
||||
</book>
|
||||
<book id="5">
|
||||
<name>Misery</name>
|
||||
<date>2018-01-31</date>
|
||||
<authorId>4</authorId>
|
||||
<availability>true</availability>
|
||||
</book>
|
||||
<book id="6">
|
||||
<name>Think and Grow Rich</name>
|
||||
<date>2004-09-10</date>
|
||||
<authorId>6</authorId>
|
||||
<availability>true</availability>
|
||||
</book>
|
||||
<book id="7">
|
||||
<name>The Law of Success</name>
|
||||
<date>1982-05-09</date>
|
||||
<authorId>6</authorId>
|
||||
<availability>false</availability>
|
||||
</book>
|
||||
<book id="8">
|
||||
<name>Patriot Games</name>
|
||||
<date>1995-10-21</date>
|
||||
<authorId>5</authorId>
|
||||
<availability>false</availability>
|
||||
</book>
|
||||
<book id="9">
|
||||
<name>The Sum of All Fears</name>
|
||||
<date>1992-09-19</date>
|
||||
<authorId>5</authorId>
|
||||
<availability>false</availability>
|
||||
</book>
|
||||
<book id="10">
|
||||
<name>The Alchemist</name>
|
||||
<date>2017-02-20</date>
|
||||
<authorId>3</authorId>
|
||||
<availability>false</availability>
|
||||
</book>
|
||||
<book id="11">
|
||||
<name>Hamlet</name>
|
||||
<date>1994-06-01</date>
|
||||
<authorId>1</authorId>
|
||||
<availability>false</availability>
|
||||
</book>
|
||||
<book id="12">
|
||||
<name>Measure for Measure</name>
|
||||
<date>1990-03-23</date>
|
||||
<authorId>1</authorId>
|
||||
<availability>false</availability>
|
||||
</book>
|
||||
<book id="13">
|
||||
<name>Hamlet</name>
|
||||
<date>1989-05-05</date>
|
||||
<authorId>1</authorId>
|
||||
<availability>true</availability>
|
||||
</book>
|
||||
<book id="14">
|
||||
<name>Hamlet</name>
|
||||
<date>1999-05-30</date>
|
||||
<authorId>1</authorId>
|
||||
<availability>true</availability>
|
||||
</book>
|
||||
<book id="15">
|
||||
<name>The Law of Success</name>
|
||||
<date>2004-11-26</date>
|
||||
<authorId>6</authorId>
|
||||
<availability>true</availability>
|
||||
</book>
|
||||
<book id="16">
|
||||
<name>Romeo and Juliet</name>
|
||||
<date>1997-02-08</date>
|
||||
<authorId>1</authorId>
|
||||
<availability>true</availability>
|
||||
</book>
|
||||
<book id="17">
|
||||
<name>The Alchemist</name>
|
||||
<date>2009-08-21</date>
|
||||
<authorId>3</authorId>
|
||||
<availability>true</availability>
|
||||
</book>
|
||||
</books>
|
||||
105
SampleData/bookNS.xml
Normal file
105
SampleData/bookNS.xml
Normal file
@@ -0,0 +1,105 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<b:books xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.demo.com" xmlns:b="http://www.book.com" xmlns:a="http://www.author.com">
|
||||
<b:book id="1">
|
||||
<b:name>Hamlet</b:name>
|
||||
<b:date>2001-05-04</b:date>
|
||||
<a:authorId>1</a:authorId>
|
||||
<b:availability>false</b:availability>
|
||||
</b:book>
|
||||
<b:book id="2">
|
||||
<b:name>Macbeth</b:name>
|
||||
<b:date>2000-12-13</b:date>
|
||||
<a:authorId>1</a:authorId>
|
||||
<b:availability>false</b:availability>
|
||||
</b:book>
|
||||
<b:book id="3">
|
||||
<b:name>Harry Potter and the Sorcerer's Stone</b:name>
|
||||
<b:date>2005-04-29</b:date>
|
||||
<a:authorId>2</a:authorId>
|
||||
<b:availability>true</b:availability>
|
||||
</b:book>
|
||||
<b:book id="4">
|
||||
<b:name>The Long Walk</b:name>
|
||||
<b:date>2018-07-01</b:date>
|
||||
<a:authorId>4</a:authorId>
|
||||
<b:availability>true</b:availability>
|
||||
</b:book>
|
||||
<b:book id="5">
|
||||
<b:name>Misery</b:name>
|
||||
<b:date>2018-01-31</b:date>
|
||||
<a:authorId>4</a:authorId>
|
||||
<b:availability>true</b:availability>
|
||||
</b:book>
|
||||
<b:book id="6">
|
||||
<b:name>Think and Grow Rich</b:name>
|
||||
<b:date>2004-09-10</b:date>
|
||||
<a:authorId>6</a:authorId>
|
||||
<b:availability>true</b:availability>
|
||||
</b:book>
|
||||
<b:book id="7">
|
||||
<b:name>The Law of Success</b:name>
|
||||
<b:date>1982-05-09</b:date>
|
||||
<a:authorId>6</a:authorId>
|
||||
<b:availability>false</b:availability>
|
||||
</b:book>
|
||||
<b:book id="8">
|
||||
<b:name>Patriot Games</b:name>
|
||||
<b:date>1995-10-21</b:date>
|
||||
<a:authorId>5</a:authorId>
|
||||
<b:availability>false</b:availability>
|
||||
</b:book>
|
||||
<b:book id="9">
|
||||
<b:name>The Sum of All Fears</b:name>
|
||||
<b:date>1992-09-19</b:date>
|
||||
<a:authorId>5</a:authorId>
|
||||
<b:availability>false</b:availability>
|
||||
</b:book>
|
||||
<b:book id="10">
|
||||
<b:name>The Alchemist</b:name>
|
||||
<b:date>2017-02-20</b:date>
|
||||
<a:authorId>3</a:authorId>
|
||||
<b:availability>false</b:availability>
|
||||
</b:book>
|
||||
<b:book id="11">
|
||||
<b:name>Hamlet</b:name>
|
||||
<b:date>1994-06-01</b:date>
|
||||
<a:authorId>1</a:authorId>
|
||||
<b:availability>false</b:availability>
|
||||
</b:book>
|
||||
<b:book id="12">
|
||||
<b:name>Measure for Measure</b:name>
|
||||
<b:date>1990-03-23</b:date>
|
||||
<a:authorId>1</a:authorId>
|
||||
<b:availability>false</b:availability>
|
||||
</b:book>
|
||||
<b:book id="13">
|
||||
<b:name>Hamlet</b:name>
|
||||
<b:date>1989-05-05</b:date>
|
||||
<a:authorId>1</a:authorId>
|
||||
<b:availability>true</b:availability>
|
||||
</b:book>
|
||||
<b:book id="14">
|
||||
<b:name>Hamlet</b:name>
|
||||
<b:date>1999-05-30</b:date>
|
||||
<a:authorId>1</a:authorId>
|
||||
<b:availability>true</b:availability>
|
||||
</b:book>
|
||||
<b:book id="15">
|
||||
<b:name>The Law of Success</b:name>
|
||||
<b:date>2004-11-26</b:date>
|
||||
<a:authorId>6</a:authorId>
|
||||
<b:availability>true</b:availability>
|
||||
</b:book>
|
||||
<b:book id="16">
|
||||
<b:name>Romeo and Juliet</b:name>
|
||||
<b:date>1997-02-08</b:date>
|
||||
<a:authorId>1</a:authorId>
|
||||
<b:availability>true</b:availability>
|
||||
</b:book>
|
||||
<b:book id="17">
|
||||
<b:name>The Alchemist</b:name>
|
||||
<b:date>2009-08-21</b:date>
|
||||
<a:authorId>3</a:authorId>
|
||||
<b:availability>true</b:availability>
|
||||
</b:book>
|
||||
</b:books>
|
||||
129
SampleData/functions20
Normal file
129
SampleData/functions20
Normal file
@@ -0,0 +1,129 @@
|
||||
abs(
|
||||
adjust-dateTime-to-timezone(
|
||||
adjust-date-to-timezone(
|
||||
adjust-time-to-timezone(
|
||||
avg(
|
||||
base-uri(
|
||||
boolean(
|
||||
ceiling(
|
||||
codepoints-to-string(
|
||||
collection(
|
||||
compare(
|
||||
concat(
|
||||
contains(
|
||||
context-item(
|
||||
count(
|
||||
current(
|
||||
current-date(
|
||||
current-dateTime(
|
||||
current-group(
|
||||
current-grouping-key(
|
||||
current-time(
|
||||
data(
|
||||
day-from-date(
|
||||
day-from-dateTime(
|
||||
days-from-dayTimeDuration(
|
||||
deep-equal(
|
||||
default-collation(
|
||||
distinct-nodes(
|
||||
distinct-values(
|
||||
doc(
|
||||
document(
|
||||
document-uri(
|
||||
element-available(
|
||||
empty(
|
||||
ends-with(
|
||||
error(
|
||||
escape-uri(
|
||||
exactly-one(
|
||||
exists(
|
||||
expanded-QName(
|
||||
false(
|
||||
floor(
|
||||
format-date(
|
||||
format-dateTime(
|
||||
format-number(
|
||||
format-time(
|
||||
function-available(
|
||||
generate-id(
|
||||
hours-from-dateTime(
|
||||
hours-from-dayTimeDuration(
|
||||
hours-from-time(
|
||||
id(
|
||||
idref(
|
||||
implicit-timezone(
|
||||
index-of(
|
||||
input(
|
||||
in-scope-prefixes(
|
||||
insert-before(
|
||||
item-at(
|
||||
key(
|
||||
lang(
|
||||
last(
|
||||
local-name(
|
||||
local-name-from-QName(
|
||||
lower-case(
|
||||
matches(
|
||||
max(
|
||||
min(
|
||||
minutes-from-dateTime(
|
||||
minutes-from-dayTimeDuration(
|
||||
minutes-from-time(
|
||||
month-from-date(
|
||||
month-from-dateTime(
|
||||
months-from-yearMonthDuration(
|
||||
name(
|
||||
namespace-uri(
|
||||
namespace-uri-for-prefix(
|
||||
namespace-uri-from-QName(
|
||||
node-kind(
|
||||
node-name(
|
||||
normalize-space(
|
||||
normalize-unicode(
|
||||
not(
|
||||
number(
|
||||
one-or-more(
|
||||
position(
|
||||
regex-group(
|
||||
remove(
|
||||
replace(
|
||||
resolve-QName(
|
||||
resolve-uri(
|
||||
reverse(
|
||||
root(
|
||||
round(
|
||||
round-half-to-even(
|
||||
seconds-from-dateTime(
|
||||
seconds-from-dayTimeDuration(
|
||||
seconds-from-time(
|
||||
sequence-node-identical(
|
||||
starts-with(
|
||||
string(
|
||||
string-join(
|
||||
string-length(
|
||||
string-pad(
|
||||
string-to-codepoints(
|
||||
subsequence(
|
||||
substring(
|
||||
substring-after(
|
||||
substring-before(
|
||||
subtract-dateTimes-yielding-dayTimeDuration(
|
||||
subtract-dateTimes-yielding-yearMonthDuration(
|
||||
sum(
|
||||
system-property(
|
||||
timezone-from-date(
|
||||
timezone-from-dateTime(
|
||||
timezone-from-time(
|
||||
tokenize(
|
||||
trace(
|
||||
translate(
|
||||
true(
|
||||
unordered(
|
||||
unparsed-entity-public-id(
|
||||
unparsed-entity-uri(
|
||||
unparsed-text(
|
||||
upper-case(
|
||||
year-from-date(
|
||||
year-from-dateTime(
|
||||
years-from-yearMonthDuration(
|
||||
zero-or-one(
|
||||
33
SampleData/sampleXML.xslt
Normal file
33
SampleData/sampleXML.xslt
Normal file
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<l:library xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.release11.com" xmlns:l="http://www.release11.com/library" xmlns:p="http://www.release11.com/person" xmlns:b="http://www.release11.com/book">
|
||||
<l:libraryName>City library</l:libraryName>
|
||||
<l:libraryID>345123</l:libraryID>
|
||||
<l:readerList>
|
||||
<p:person>
|
||||
<p:readerID>7321</p:readerID>
|
||||
<p:name>Adam</p:name>
|
||||
<p:surname>Choke</p:surname>
|
||||
</p:person>
|
||||
<p:person>
|
||||
<p:readerID>5123</p:readerID>
|
||||
<p:name>Lauren</p:name>
|
||||
<p:surname>Wong</p:surname>
|
||||
</p:person>
|
||||
</l:readerList>
|
||||
<l:bookList>
|
||||
<b:book>
|
||||
<b:bookID>6422</b:bookID>
|
||||
<b:title>Harry Potter</b:title>
|
||||
<p:readerID>7542</p:readerID>
|
||||
</b:book>
|
||||
<b:book>
|
||||
<b:bookID>1234</b:bookID>
|
||||
<b:title>Macbeth</b:title>
|
||||
<p:readerID>5123</p:readerID>
|
||||
</b:book>
|
||||
<b:book>
|
||||
<b:bookID>9556</b:bookID>
|
||||
<b:title>Romeo and Juliet</b:title>
|
||||
</b:book>
|
||||
</l:bookList>
|
||||
</l:library>
|
||||
9
SampleData/transform.xslt
Normal file
9
SampleData/transform.xslt
Normal file
@@ -0,0 +1,9 @@
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:b="http://www.demo.com">
|
||||
<xsl:template match="b:books">
|
||||
<Library>
|
||||
<BookCount>
|
||||
<xsl:value-of select="count(b:book)" />
|
||||
</BookCount>
|
||||
</Library>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
||||
16
docker-compose.yml
Normal file
16
docker-compose.yml
Normal file
@@ -0,0 +1,16 @@
|
||||
version: "3"
|
||||
|
||||
services:
|
||||
xmltools-frontend:
|
||||
build: ./Homepage
|
||||
container_name: xmltools-frontend
|
||||
image: xmltools-frontend
|
||||
ports:
|
||||
- 8086:80
|
||||
|
||||
xmltools-backend:
|
||||
build: ./REST_XSLT
|
||||
container_name: xmltools-backend
|
||||
image: xmltools-backend
|
||||
ports:
|
||||
- 8081:8081
|
||||
Reference in New Issue
Block a user