From de1b9a61f864296e125bff583476717314acde51 Mon Sep 17 00:00:00 2001 From: Paul Merrill Date: Sat, 9 Jul 2011 21:48:33 -0700 Subject: [PATCH] XML parsing decended too deep with new XML docs --- src/sprite.cpp | 5 ++--- src/world.cpp | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/sprite.cpp b/src/sprite.cpp index c6bdf18..8d8b81d 100644 --- a/src/sprite.cpp +++ b/src/sprite.cpp @@ -32,12 +32,11 @@ bool Sprite::processDescriptor() XMLDocRef doc = rc->getXMLDoc(descriptor, "dtd/sprite.dtd"); if (!doc) return false; - const xmlNode* root = xmlDocGetRootElement(doc.get()); + const xmlNode* root = xmlDocGetRootElement(doc.get()); // if (!root) return false; - xmlNode* node = root->xmlChildrenNode; // + xmlNode* node = root->xmlChildrenNode; // decend into children of - node = node->xmlChildrenNode; // decend into children of for (; node != NULL; node = node->next) { if (!xmlStrncmp(node->name, BAD_CAST("sheet"), 6)) { str = xmlNodeGetContent(node); diff --git a/src/world.cpp b/src/world.cpp index 97d881d..61b85cd 100644 --- a/src/world.cpp +++ b/src/world.cpp @@ -71,12 +71,11 @@ bool World::processDescriptor() XMLDocRef doc = rc->getXMLDoc(descriptor, "dtd/world.dtd"); if (!doc) return false; - const xmlNode* root = xmlDocGetRootElement(doc.get()); + const xmlNode* root = xmlDocGetRootElement(doc.get()); // if (!root) return false; - xmlNode* node = root->xmlChildrenNode; // - node = node->xmlChildrenNode; // decend into children of + xmlNode* node = root->xmlChildrenNode; // children of for (; node != NULL; node = node->next) { if (!xmlStrncmp(node->name, BAD_CAST("name"), 5)) { str = xmlNodeGetContent(node); -- 2.11.4.GIT