Hello,
I currently am trying to sort a list of objects inside an instance with the
xxf:sort function to sort the list based off a date inside the objects.
I have the following data
(code)
<xf:instance>
<activityDataWrapper>
<activityDataList>
<createdOn>2019-07-30T10:24:55+10:00</createdOn>
<id>63</id>
<info>
<documentationQueryInfo>
<id>63</id>
<request>My Request 1</request>
<response>test</response>
</documentationQueryInfo>
<id>63</id>
<requestor>joeladmin</requestor>
<responder>john</responder>
</info>
<state>Responded</state>
<type>DocumentQuery</type>
</activityDataList>
<activityDataList>
<createdOn>2019-07-30T13:30:43+10:00</createdOn>
<id>65</id>
<info>
<documentationQueryInfo>
<id>65</id>
<request>hello</request>
<response>sdfsdfsfsdfsdf</response>
</documentationQueryInfo>
<id>65</id>
<requestor>joeladmin</requestor>
<responder>CodingUser</responder>
</info>
<state>Responded</state>
<type>DocumentQuery</type>
</activityDataList>
<activityDataList>
<createdOn>2019-07-30T13:05:09+10:00</createdOn>
<id>64</id>
<info>
<documentationQueryInfo>
<id>64</id>
<request>temp</request>
<response>cooli</response>
</documentationQueryInfo>
<id>64</id>
<requestor>joeladmin</requestor>
<responder>john</responder>
</info>
<state>Responded</state>
<type>DocumentQuery</type>
</activityDataList>
</activityDataWrapper>
</xf:instance>
(code)
I am trying to sort this list of activityDataList entries by the createdOn
field which is a date.
I am trying to use the following code to sort the list
(code)
<xf:action ev:event="xforms-ready">
<xf:itemset ref="xxf:sort(instance(), activityDataList/createdOn,
'dateTime', 'ascending')"/>
</xf:action>
(code)
Following
https://doc.orbeon.com/xforms/xpath/extension-functions/extension-xml#xxf-sort
however I am not getting the desired result.
The result I am looking for the the activityDataList to be sorted into
Ascending order.
Any Idea to get my desired result?
Cheers,
Joel.
--
Sent from:
http://discuss.orbeon.com/