How to get tag parameter value with XQuery

For example i have this xml. I need to get value of parameter val of tag foo with id="two"

    <sub id="one">
        <foo id="two" val="bar" />

Whis this query (using Qt QXmlQuery):


I receive <p val="bar"/>, but I need only text "bar" without any tags. I tried to remove <p> and </p> and receive syntax error, unexpected {

How can i get parameter value without any tags?


If you try to serialize just an attribute you will get an error. You may be better off just retrieving the value of the attribute:


Sorry a bit late in the day... try


which returns just the text value of the attribute


Need Your Help

Unique field in cloud kit while syncing with local core data cache

ios database core-data duplicates cloud

Am trying to implement cloudkit sync with local core data stack, I had a few doubts as follows

How to integrate pystache with pyramid?

python template-engine pyramid mustache

I would like to use the class based views that pystache offers in my pyramid application, but I'm not entirely sure how to integrate the two properly. I've read this already, but it doesn't talk ab...