Hi,

First time using QT and XML. Here is my simple XML file.
Qt Code:
  1. <?xml version="1.0"?>
  2.  
  3. <Node nodetype="atomic"
  4. header="atomic.h">
  5.  
  6. <Input name="inNumber" type="color" value="0.2,0.3,0.5"/>
  7. <Output name="outNumber" type="float" value="0.5"/>
  8.  
  9. </Node>
To copy to clipboard, switch view to plain text mode 

and here is the QT code:
Qt Code:
  1. QFile file("atomic.xml");
  2. if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
  3. return 0;
  4.  
  5. if (!doc.setContent(&file)) {
  6. file.close();
  7. return 0;
  8. }
  9. file.close();
  10.  
  11. QDomNode n = doc.firstChild();
  12.  
  13. while(!n.isNull()) {
  14.  
  15. if(n.isElement()) {
  16.  
  17. QDomElement e = n.toElement();
  18. QString name = e.tagName();
  19.  
  20. qDebug() << name;
  21.  
  22. if(name == "Node") {
  23.  
  24. QString nodeType = e.attribute("nodetype","");
  25. QString header = e.attribute("header","");
  26. qDebug() << nodeType << header;
  27.  
  28. } else if(name == "Input") {
  29.  
  30. QString name1 = e.attribute("name","");
  31. QString type1 = e.attribute("type","");
  32. QString value1 = e.attribute("value","");
  33.  
  34. qDebug() << name1 << type1 << value1;
  35. }
  36. }
  37. n = n.nextSibling();
  38. }
To copy to clipboard, switch view to plain text mode 

Problem 1
The code is not entering in condition:
Qt Code:
  1. else if(name == "Input") {
To copy to clipboard, switch view to plain text mode 

Cheers

Prashant