DRDE/ACTK1_0/se/LPE/LPChkRespExtension.cpp
Ren RenJuan dbef59cf01 *
2014-01-27 17:24:42 +00:00

45 lines
1 KiB
C++

#include "xml/XMLDocument.hpp"
#include "se/Response.hpp"
#include "se/ResponseExtension.hpp"
#include "se/LPE/LPChkRespExtension.hpp"
#include <xalanc/XalanDOM/XalanNamedNodeMap.hpp>
#include <xalanc/XalanDOM/XalanDOMString.hpp>
extern mdLogger mdLog;
XALAN_USING_XALAN(XalanDOMString)
/*
* Have to use static funcion instead of static variable
* since there is not guarantee about the construct/destruct
* order of a static instance of any types
*/
const std::string LPChkRespExtension::CKCLAIM_EXPR()
{
return EXTENSION_EXPR() + "//launch:name@exists";
}
LPChkRespExtension::LPChkRespExtension() : typeIsClaims(true), initialised(false)
{
}
void LPChkRespExtension::fromXML(XMLDocument *xmlDoc)
{
const std::string respElement = CKCLAIM_EXPR();
const XalanNode * responSE = xmlDoc->getElement(respElement);
const XalanDOMString respValue("false");
initialised = true;
if (!responSE) {
mdLog.logN(0,"Parse error in LPChkResponse");
}
else {
if (responSE->getNodeValue().compare(respValue) != 0)
response = true;
}
}