Changeset 152

Show
Ignore:
Timestamp:
07/01/08 14:59:45 (6 months ago)
Author:
zork
Message:

added root node check

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/dba/dba/xmlarchive.cpp

    r150 r152  
    4646        throw XMLException("Error reading file"); 
    4747    }; 
     48    xmlNodePtr root = xmlDocGetRootElement(mDocument); 
     49    if (root == NULL) 
     50      throw DataException("Root node not found"); 
     51    if (root->name == NULL) 
     52      throw DataException("Root node has no name"); 
     53    if (xmlStrcmp(mRootNodeName,root->name)) 
     54      throw DataException("Wrong root node name, forgot to call setRootNodeName?"); 
    4855  } else { 
    4956    mDocument = xmlNewDoc((const xmlChar*)"1.0");