我有这个示例 XML-RPC 响应:
<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>
我需要在 QML 中使用 dateTime() 函数(和其他与日期/时间相关的函数)查询 dateTime。使用此查询总是返回错误:
struct/member[name='post_date']/value/dateTime.iso8601/dateTime()
错误:
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()"
我仍然可以使用该格式成功查询其他字段。