Hi all,<br><br>Can someone explain me how to use QXmlQuery. I have simple XML file on the filesystem and I need to get one piece of it. My code following:<br><br><span style="font-family: courier new,monospace;"> out = QString()<br>
query = QXmlQuery()</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> query.setMessageHandler(handler)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> q_str = 'doc("./uis/logic.xml")/logic/rule'</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> query.setQuery(q_str)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"><br> if not query.isValid():</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> print 'not valid'</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> if not query.evaluateTo(out)</span>:<br><span style="font-family: courier new,monospace;"> print 'not evaluated'<br>
<br></span>It shows me 'not evaluated' for:<br><span style="font-family: courier new,monospace;"><br></span><span style="font-family: courier new,monospace;"><?xml version="1.0" encoding="UTF-8"?><br>
<logic name="card_types" version="1.0"><br> <rule name="flyer"><br> <sequence/><br> </rule><br> <rule name="test"><br> <sequence><br> <dialog type="list" name="category"/><br>
</sequence><br> </rule><br></logic><br><br></span>-- <br>Ruslan Popov<br>phone: +7 916 926 1205<br><br>