Skip to content

Commit

Permalink
Try XML children if root is empty
Browse files Browse the repository at this point in the history
See #2
  • Loading branch information
tbeu committed Sep 9, 2015
1 parent d59848a commit a3cf77f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ExternData/Resources/C-Sources/ED_XMLFile.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,11 @@ void ED_getDoubleArray1DFromXML(void* _xml, const char* varName, double* a, size
if (xml != NULL) {
XmlNodeRef root = xml->root;
char* token = findValue(&root, varName, xml->fileName);
while (token == NULL && XmlNode_getChildCount(root) > 0) {
/* Try children if root is empty */
root = XmlNode_getChild(root, 0);
XmlNode_getValue(root, &token);
}
if (token != NULL) {
char* buf = strdup(token);
if (buf != NULL) {
Expand Down

0 comments on commit a3cf77f

Please sign in to comment.