[Interest] QXmlQuery attribute value only

Scott Bloom scott at towel42.com
Wed Aug 2 19:25:20 CEST 2017


I am trying to do the following

Project/FileSet/File/@Name

Where Name is an attribute on the File node example <File Name="foo.cpp">

Using any of the online javascript XML/XPath testers, this XPath query works fine.

However, using
QXmlQuery query on the file, and evaluating to a QString, the string in empty.  I have also tried QStringList.

When I change the query to "Project/FileSet/File" I get the full node for <File ...> and I can extract out the attribute I need, but this is not really what I want to do.

Any suggestions?  To say the documentation for QXmlQuery is lacking examples is an understatement.

Scott



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20170802/78a94bb1/attachment.html>


More information about the Interest mailing list