|
From: <axl...@us...> - 2009-04-05 23:21:52
|
Revision: 203
http://hgengine.svn.sourceforge.net/hgengine/?rev=203&view=rev
Author: axlecrusher
Date: 2009-04-05 23:21:37 +0000 (Sun, 05 Apr 2009)
Log Message:
-----------
fix fallback nodes not having documents attached
Modified Paths:
--------------
Mercury2/src/XMLParser.cpp
Modified: Mercury2/src/XMLParser.cpp
===================================================================
--- Mercury2/src/XMLParser.cpp 2009-04-05 14:35:16 UTC (rev 202)
+++ Mercury2/src/XMLParser.cpp 2009-04-05 23:21:37 UTC (rev 203)
@@ -100,8 +100,11 @@
}
else
{
- XMLNode fall = FindFallbackNode();
- data = fall.Attribute(tag);
+ if (tag != "name") //probably don't want to fallback for names if a name does not exist
+ {
+ XMLNode fall = FindFallbackNode();
+ data = fall.Attribute(tag);
+ }
}
return data;
@@ -115,7 +118,7 @@
if (d)
{
//start searching at the root
- XMLNode root( xmlDocGetRootElement(m_doc) );
+ XMLNode root( xmlDocGetRootElement(m_doc), m_doc );
//prevent infinite recursion on self
if ( root.m_node != m_node )
{
@@ -133,16 +136,13 @@
if (path.length() > 0)
{
- printf("finding fallback %s\n", path.c_str());
int pos = path.find(".");
MString name = pos<=0?path:path.substr(0, pos);
MString rpath = pos<=0?"":path.substr(pos+1); //skip the period
for (XMLNode n = this->Child(); n.IsValid(); n = n.NextNode())
if (n.Attribute("name") == name)
- {
- printf("found fallback %s\n", name.c_str());
return n.RecursiveFindFallbackNode(rpath);
- }
+
return XMLNode();
}
return *this;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|