I have this sample XML-RPC response:
<struct>
<member><name>post_id</name><value><string>131</string></value></member>
<member><name>post_title</name><value><string>Test with secret password</string></value></member>
<member><name>post_date</name><value><dateTime.iso8601>20080404T09:38:05</dateTime.iso8601></value></member>
<member><name>post_thumbnail</name><value><string>http://localhost/~herop-kde/wordpress/wp-content/themes/twentyeleven/images/thumbnails/119.jpg</string></value></member>
</struct>
I need to query the dateTime using dateTime() function (and other date/time relating functions) in QML. Using this query always returns error:
struct/member[name='post_date']/value/dateTime.iso8601/dateTime()
The error:
Error XPST0017 in [...] at line 2, column 96: fn:dateTime($arg1 as xs:date?, $arg2 as xs:time?) as xs:dateTime? requires at least 2 argument(s). 0 is therefore invalid.
[...]/Main.qml:37:13: QML XmlRole: invalid query: "struct/member[name='post_date']/value/dateTime.iso8601/dateTime()"
I still can use that format to query other fields successfully.
If xml contains properly formatted iso8601 date (2008-04-04T09:38:05) you could use
xs:dateTimefunction:Otherwise you’ll have to get it as string and do conversion/formatting in your javascript code.