http://bugs.winehq.org/show_bug.cgi?id=4286
--- Comment #37 from Nikolay Sivov bunglehead@gmail.com 2010-06-23 14:25:40 --- First problem is in XPath evaluation or maybe expected MS-only called XSLPattern. A position predicate starts with invalid index like:
--- 001d:trace:msxml:xmlnode_selectSingleNode (0x174698)->(L"Tips/Tip[0]" 0x1fac820) 001d:trace:msxml:xmlnode_selectNodes (0x174698)->(L"Tips/Tip[0]" 0x1fac7d0) 001d:trace:msxml:queryresult_create (0x7c102fc0, L"Tips/Tip[0]", 0x1fac7d0) 001d:trace:msxml:xmldoc_add_ref (0x7c102fc0)->(3) 001d:trace:msxml:queryresult_create found 0 matches ---
<Tips> does indeed contain a list of <Tip> nodes (about 30 of them), but in terms of XPath a starting index for first node is 1 (http://www.w3.org/TR/xpath/#predicates).
This needs some tests, for XPath vs XSLPattern switch. Anyway we need pre-parse query string before passing it to libxml2 it seems.
Next problem is similar to bug 20223 - additional node expected for "<?xml" declaration, attached patch doesn't work though (I need to study libxml2 code more to hack it properly).