Hello.

I've got next problem.

I made my own DTD scheme, then I built corresponding XML and then I tried to read data from it using the next QT classes:
QDomDocument
QDomElement
QDomNode

DTD:
Qt Code:
  1. ......
  2. <!DOCTYPE GCAD3_HOST_GUI_SCHEME [
  3. <!ELEMENT GCAD3_HOST_GUI_SCHEME (ACTION_MANAGER, CONFIGURATION_MANAGER, MAIN_MENU, FUNCTION_EXPLORER, TOOL_BARS)>
  4. <!ATTLIST GCAD3_HOST_GUI_SCHEME
  5. AUTOMATIC_LOAD_STATIC_PART (1|0) #FIXED "1"
  6. AUTOMATIC_LOAD_DYNAMIC_PART (1|0) "1">
  7. ......
To copy to clipboard, switch view to plain text mode 

XML:
Qt Code:
  1. ....
  2. <GCAD3_HOST_GUI_SCHEME AUTOMATIC_LOAD_DYNAMIC_PART="0">
  3. ....
To copy to clipboard, switch view to plain text mode 

Attribute AUTOMATIC_LOAD_STATIC_PART is omitted as you can see!

Then I was trying to extract the current value of this attribute from C++.

C++:
Qt Code:
  1. ....
  2. QFile* v_xml_gui_file = new QFile(v_curr_xml);
  3.  
  4. if (v_xml_gui_file->open(QIODevice::ReadOnly))
  5. {
  6. auto_ptr<QDomDocument> v_xml_gui(new QDomDocument());
  7. QString v_parseErrors;
  8. int v_errLine, v_errCol;
  9. if (!v_xml_gui->setContent(v_xml_gui_file,true,&v_parseErrors,&v_errLine,&v_errCol) )
  10. {return;}
  11. QDomElement root = v_xml_gui->documentElement();
  12. root.nodeType()
  13. QDomNode n = root.firstChild();
  14.  
  15. QString v_defValue1, v_defValue2;
  16. int v_static= root.attribute("AUTOMATIC_LOAD_STATIC_PART",v_defValue1).toInt();
  17. int v_dynamic= root.attribute("AUTOMATIC_LOAD_DYNAMIC_PART",v_defValue2).toInt();
  18. }
  19. ....
To copy to clipboard, switch view to plain text mode 

Result of execution of this code was the next:
v_static == 0 (but "1" was expected)
v_defValue1 == 0

v_dynamic == 0 (but "1" was expected)
v_defValue1 == 0

I use: Visual Studio 2008, WindowsXP (platform), QT 4.3.3

Is there anyone who know what I have done wrong ?

Thanks for participate