I have tried right now:<br><br><span style="font-family: courier new,monospace;">q_str = 'doc("/home/rad/project/qt/manager/uis/logic.xml")/logic/rule</span><br style="font-family: courier new,monospace;"><div style="font-family: courier new,monospace;" class="im">
query.setQuery(q_str)</div><br>also I have handler like this:<br><br><span style="font-family: courier new,monospace;">class Handler(QAbstractMessageHandler):</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> def handleMessage(self, msg_type, desc, identifier, loc):</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> print 'QUERY:', msg_type, desc, identifier, loc</span><br style="font-family: courier new,monospace;"><br>and it responds this time:<br><br><span style="font-family: courier new,monospace;">QUERY: 3 <html xmlns='<a href="http://www.w3.org/1999/xhtml/">http://www.w3.org/1999/xhtml/</a>'><body><p>syntax error, unexpected &lt;number literal&gt;, expecting )</p></body></html> PyQt4.QtCore.QUrl(u'<a href="http://www.w3.org/2005/xqt-errors#XPST0003">http://www.w3.org/2005/xqt-errors#XPST0003</a>') <PyQt4.QtXmlPatterns.QSourceLocation object at 0x2204120></span><br style="font-family: courier new,monospace;">
<br><br><div class="gmail_quote">On Tue, Jun 22, 2010 at 8:38 PM, David Boddie <span dir="ltr"><<a href="mailto:dboddie@trolltech.com">dboddie@trolltech.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">On Tue Jun 22 07:03:51 BST 2010, Ruslan Popov wrote:<br>
<br>
> Can someone explain me how to use QXmlQuery. I have simple XML file on the<br>
> filesystem and I need to get one piece of it. My code following:<br>
><br>
> out = QString()<br>
> query = QXmlQuery()<br>
> query.setMessageHandler(handler)<br>
> q_str = 'doc("./uis/logic.xml")/logic/rule'<br>
> query.setQuery(q_str)<br>
<br>
</div>Have you tried using an absolute path instead of "./uis/logic.xml"?<br>
<font color="#888888"><br>
David<br>
</font><div><div></div><div class="h5">_______________________________________________<br>
PyQt mailing list <a href="mailto:PyQt@riverbankcomputing.com">PyQt@riverbankcomputing.com</a><br>
<a href="http://www.riverbankcomputing.com/mailman/listinfo/pyqt" target="_blank">http://www.riverbankcomputing.com/mailman/listinfo/pyqt</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Ruslan Popov<br>phone: +7 916 926 1205<br><br>