Questions tagged [qdomdocument]

In Qt, the QDomDocument class represents an XML document.

In Qt, the QDomDocument class represents an XML document.

The QDomDocument class represents the entire XML document. Conceptually, it is the root of the document tree, and provides the primary access to the document's data.

Useful link

32 questions
2
votes
1 answer

Search for nodes in a QDomDocument using XPath

I am spoiled (rotten, to be sure) by C# and its XML manipulation classes in the System.Xml namespace. I can load an XML file into an XmlDocument. I can search the whole document for nodes that match an XPath expression, using XmlNode.SelectNodes(…
Mike Finch
  • 746
  • 1
  • 7
  • 20
2
votes
1 answer

How to return null QDomElement?

Qt XML manipulation is kind of weird - although the QDomElement objects refer to their representations in document, they are not pointers. To indicate "null" element, isNull method is used. How do I create QDomElement that returns true on isNull?
Tomáš Zato
  • 50,171
  • 52
  • 268
  • 778
1
vote
1 answer

How to save double quotes in XML header using QDomDocument

Before opening XML document the header was But after using QDomDocument if (!file.open((QIODevice::ReadOnly))) { return; } QDomDocument document; if (!document.setContent(&file)) { …
1
vote
1 answer

Deleting nodes in nested xml removes the nodes from QDomNodeList, however when saving the file, there is no change

I have a big xml file that I need to remove specific nodes from QString filename= QFileDialog::getOpenFileName(this, "Choose File"); if(filename.isEmpty()) return; QFile file(filename); if (!file.open(QIODevice::ReadWrite | QIODevice::Text)) …
DanC225
  • 171
  • 14
1
vote
0 answers

Seeking Qt5 WYSIGWG editor design advice

I am planning a new desktop application. It will provide a WYSIWYG editor for HL7 files (OSS Project). HL7 is a structured file format often used by hospitals for exchanging data between systems. The basic structure of the format comprises of…
Spliffster
  • 6,959
  • 2
  • 24
  • 19
1
vote
2 answers

Should I create a new QDomDocument on the heap?

I will load multiple XML files, each into a QDomDocument, and then use a QMap to associate an identifying string with each document. Should I store a QDomDocument or a pointer to a QDomDocument in the map? i.e., which of the following examples is…
Mike Finch
  • 746
  • 1
  • 7
  • 20
1
vote
1 answer

Better way to use QDomDocument data as text

I am a newbie, I am creating a XML file in which I need to give CRC value to cross check on server. For this I need QDomDocument data as text. For this I am first creating XML file with fake CRC value. Then I open it with QFile and read all data.…
Tabish Saifullah
  • 570
  • 1
  • 5
  • 25
1
vote
1 answer

How to parse an unknown xml in Qt and get all the attributes in it?

I have several xml documents with the following style, but each of them containing different nodes. Example
Á. Márton
  • 497
  • 1
  • 3
  • 21
1
vote
1 answer

How to get last node of XML file in QT?

In my current project i am parsing the XML file using QDomDocument class. My XML file look like bellow:
James 30/09/1980
1
vote
1 answer

Lastchild in xml file using QDomDocument Class

i have this xml:
1
vote
2 answers

Error while loading larger files with setContent(&file) at a qt DOM xml Parser

I'm running into a strange problem which i cannot solve. It seems nobody has this problem. While loading a small XML file (4mb) everything ist fine and the programm runs normal, but when i'm trying to load a larger file (200mb) the programm crashes…
Xref_failed
  • 43
  • 10
1
vote
1 answer

Remove line from XML with QDomDocument

Im working with XML files in Qt, and i need to copy an XML file and then append to the copy. One issue im having is i need to delete the very last line of the XML file which is: I am very new to working with XMLs in Qt and using…
Cody Pritchard
  • 635
  • 1
  • 9
  • 28
1
vote
2 answers

How to concatenate QDomDocument::createElement calls?

I do use the QtXML Module providing a "nice" DOM-Model for Qt. The problem i encounter is, one cannot concatenate the calls making one require to create extra QDomElement variables for appending. Is there a way around this? QDomDocument…
Sebastian Lange
  • 3,879
  • 1
  • 19
  • 38
0
votes
1 answer

Add node to Existing Root Element

I am trying to add child node to an existing root node using C++ QDOM element but unsuccessful. My xml would be like this. and I am trying to add so it could be like…
0
votes
1 answer

Qt c++ data from XML String not being displayed properly in QTableView after parsing

I have almost finished the program in this question, but the last problem right now is this: There is missing information within the QTableView. Below is the new code I have: (the header file and the input xml string is the same as in the question…
1
2 3