in Education by
I have an XML and would like to : sort on employeeNumber, and for each bookingtime by year, month, day ascending. Example : <?xml version="1.0" encoding="UTF-8"?> Bob the Builder 00290035 g 2019 3 18 14 52 0 Bob the Builder 00290035 c 2019 3 18 14 22 0 Mike Zeh 00200060 c 2019 3 17 10 15 0 Can anyone help me do this properly? The XSLT version used can be any, no specific version required. I made a small fiddle (https://xsltfiddle.liberty-development.net/ej9EGce), the sorting on employeeNumber works, year / month etc fails. JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
I like Aljandro's answer, but in case somebody insists on using a higher version of XSLT and treating the values really as those of year, month, day-of-month, hours, minutes and seconds, then something like below can be used, This transformation may look a little bit more complex, but it treats the children of as values of these typed objects and will throw an error if an invalid component value is encountered -- such as Feb 30th, month: 13, hour: 25, or minute/second 61 When this transformation is applied on the provided source xml document: Bob the Builder 00290035 g 2019 3 18 14 52 0 Bob the Builder 00290035 c 2018 3 18 14 22 0 Mike Zeh 00200060 c 2019 3 17 10 15 0 the wanted, correct result is produced: Mike Zeh 00200060 c 2019 3 17 10 15 0 Bob the Builder 00290035 c 2018 3 18 14 22 0 Bob the Builder 00290035 g 2019 3 18 14 52 0

Related questions

0 votes
    In my XSLT stylesheet I extract the value of the current month using a month-from-dateTime like this . ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 17, 2022 in Education by JackTerrance
0 votes
    I have an XML with Text elements that can include tagged text and depending on the elements attribute value ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 13, 2022 in Education by JackTerrance
0 votes
    I have followed through some of the threads discussing ouput escaping in XSLT but none seesm to address the ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 19, 2022 in Education by JackTerrance
0 votes
    I have an XSLT like this: In the second template, which matches nodes in the fooDocument.xml which is ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 19, 2022 in Education by JackTerrance
0 votes
    I have followed through some of the threads discussing ouput escaping in XSLT but none seesm to address the ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 19, 2022 in Education by JackTerrance
0 votes
    I have an XSLT like this: In the second template, which matches nodes in the fooDocument.xml which is ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 13, 2022 in Education by JackTerrance
0 votes
    I am getting Facebook users' friends birthday back from Facebook in the following format: 10/07/1967 or ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 21, 2022 in Education by JackTerrance
0 votes
    I am getting Facebook users' friends birthday back from Facebook in the following format: 10/07/1967 or ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 21, 2022 in Education by JackTerrance
0 votes
    Which of the following input control represents a date (year, month, day) encoded according to ISO 8601 in Web Form 2.0?...
asked Apr 10, 2021 in Education by JackTerrance
0 votes
    Which of the following input control represents a date (year, month, day) encoded according to ISO 8601 in Web Form 2.0? A - datetime B - datetime-local C - date D - month...
asked Dec 1, 2020 in Technology by JackTerrance
0 votes
    A clock is started at noon. By 10 minutes past 5, the hour hand has turned through: A) 145 B) 150 C) 155 D) 160...
asked Feb 13, 2021 in Education by JackTerrance
0 votes
    A clock is started at 11 a.m. By 600 seconds past 6 p.m, the hour hand has turned through ? A) 155 degrees B) 175 degrees C) 205 degrees D) 215 degrees...
asked Feb 14, 2021 in Education by JackTerrance
0 votes
    n cloud, service uptime is 64 minutes and downtime is 16 minutes in an hour. What is the availability of the service? Select the correct answer from above options...
asked Dec 24, 2021 in Education by JackTerrance
0 votes
    There is a clock which shows false timing ie it shows 20 minutes less for each 1 hour. If the clock shows 12 noon now how ... ) 36 minutes B) 48 minutes C) 35 minutes D) 60 minutes...
asked Feb 14, 2021 in Education by JackTerrance
...