Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QXmlQuery
Forum Updated to NodeBB v4.3 + New Features

QXmlQuery

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 317 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    meobeou
    wrote on last edited by VRonin
    #1

    Hello,

    I would like to know if it is possible to insert/modify/remove data with an XQuery using QXmlQuery?

    I found an "exemple":http://www.xmlmind.com/tutorials/XQueryUpdate/index.html of XQuery updating some data with the following query but I am not able to run it:

    for $idattr in doc("data.xml")//ITEM/@Id (: selection :)
    return (
    delete node $idattr, (: update 1 :)
    insert node <NID>{string($idattr)}</NID> (: update 2 :)
    as first into $idattr/..
    )
    

    I have the following error :
    syntax error, unexpected node, expecting )

    If it is not possible to use insert or delete how I am suppose to modify the content of a document?

    Thanks
    Lee!

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      I don't think it's implemented. You can use the QXmlStreamReader/Writer classes to read modify/write or QDomDocument.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      3

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved