I need to collapse a list of arrival dates to only view the unique dates.
The data is like this:
<arrivals> <arrival> <stayid>10399</stayid> <transport>Fly fra Kastrup</transport> <roomtype>Dubbelrum med bad/toalett</roomtype> <price>9995.00</price> <arrivaldate>12/09/2011</arrivaldate> <bookingurl>http://booking.domain.se/order.aspx?ps=10399</bookingurl>; </arrival> <arrival> <stayid>10399</stayid> <transport>Fly fra Aalborg</transport> <roomtype>Dubbelrum med bad/toalett</roomtype> <price>9995.00</price> <arrivaldate>12/09/2011</arrivaldate> <bookingurl>http://booking.domain.se/order.aspx?ps=10399</bookingurl>; </arrival> </arrivals>
Now I would like to view the dates in a dropdown box. When a date is selected and the user clicks the order button he is redirected to the "bookingurl".
Anyone who can help me getting only the unique dates?
I have tried with Exslt.ExsltSets:distinct($list), where $list is a comma seperated list of the dates.
Not tested, just copied/edited from an example I posted for selecting unique Countries here. Should work though, just replace $yourXml with wherever you are loading your custom XML from.
Also if the dates are in different formats you can use umbraco.library:FormatDateTime on the key's use attribute and in the XPath for selecting.
Select distinct values
Hi
I need to collapse a list of arrival dates to only view the unique dates.
The data is like this:
Now I would like to view the dates in a dropdown box. When a date is selected and the user clicks the order button he is redirected to the "bookingurl".
Anyone who can help me getting only the unique dates?
I have tried with Exslt.ExsltSets:distinct($list), where $list is a comma seperated list of the dates.
Hi Kasper,
You can use XSLT keys for this. Here is a simple example:
Not tested, just copied/edited from an example I posted for selecting unique Countries here. Should work though, just replace $yourXml with wherever you are loading your custom XML from.
Also if the dates are in different formats you can use umbraco.library:FormatDateTime on the key's use attribute and in the XPath for selecting.
Hope this helps,
Tom
Yaer! Thanks!
is working on a reply...