If cur specified in OhmmsXPathObject, set cur as context.

git-svn-id: https://subversion.assembla.com/svn/qmcdev/trunk@6235 e5b18d87-469d-4833-9cc0-8cdfa06e9491
This commit is contained in:
Raymond Clay 2014-02-18 22:31:33 +00:00
parent 797826a26d
commit f2a1225dc4
2 changed files with 6 additions and 2 deletions

View File

@ -19,6 +19,7 @@
#include "Message/Communicate.h"
#include "Utilities/Timer.h"
#include <fstream>
#include <iostream>
OhmmsXPathObject::OhmmsXPathObject(): NumObjects(0), result(NULL),m_context(NULL)
{
@ -30,9 +31,12 @@ OhmmsXPathObject::OhmmsXPathObject(const char* expression,
put(expression, context);
}
OhmmsXPathObject::OhmmsXPathObject(const char* expression, xmlNodePtr cur) :NumObjects(0), result(NULL)
OhmmsXPathObject::OhmmsXPathObject(const char* expression, xmlNodePtr cur) :NumObjects(0), result(NULL), m_context(NULL)
{
m_context= xmlXPathNewContext(cur->doc);
//sets up "cur" as the context, and will return matches within this node
// if not overridden in "expression".
xmlXPathSetContextNode(cur, m_context);
put(expression, m_context);
}

View File

@ -19,7 +19,7 @@
#include "OhmmsData/libxmldefs.h"
#include <string>
/** class to handle xmlXPathObject
*/
*/
struct OhmmsXPathObject
{