Workaholic | 🤸🏻 | Learning library
kandi X-RAY | Workaholic Summary
kandi X-RAY | Workaholic Summary
A Github's like work contribution timeline.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of Workaholic
Workaholic Key Features
Workaholic Examples and Code Snippets
Community Discussions
Trending Discussions on Workaholic
QUESTION
I need to sort a sequence of elements using plain XPath 3.0, so no XQuery, no XSL-T and no code. I tried following this answer on how to use the sort function, but I'm not an expert in XPath, so I couldn't figure out how to use it.
So, my document basically has the following structure:
...ANSWER
Answered 2018-Mar-29 at 16:01The function fn:sort(...)
exists in three versions, with up to three arguments:
$input as item()*
: the input sequence,$collation as xs:string?
: the collation for string comparison (or an empty sequence),$key as function(item()) as xs:anyAtomicType*) as item()*
: a function item that extracts the sort key (i.e. the part that should be compared) from the items to sort.
Since you don't want to sort strings, the second argument should be ()
.
The sort key in your case is the starting date and time of each appointment. So you need to supply a function item that, given an Appointment
node, returns the xs:dateTime
of its start date: function($app) { fn:dateTime($app/Start/@date, $app/Start/@time) }
Putting everything together:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Workaholic
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page