Static Public Member Functions | |
static xsd::cxx::xml::dom::auto_ptr < xercesc::DOMDocument > | ReadFileToDomDocument (const std::string &rFileName,::xml_schema::error_handler &rErrorHandler, const ::xml_schema::properties &rProps) |
static void | PrintNode (const std::string &rMsg, xercesc::DOMNode *pNode, bool showChildren=false) |
static xercesc::DOMElement * | SetNamespace (xercesc::DOMDocument *pDocument, xercesc::DOMElement *pElement, const std::string &rNamespace) |
static xercesc::DOMElement * | SetNamespace (xercesc::DOMDocument *pDocument, xercesc::DOMElement *pElement, const XMLCh *pNamespace) |
static void | WrapContentInElement (xercesc::DOMDocument *pDocument, xercesc::DOMElement *pElement, const XMLCh *pNewElementLocalName) |
static std::vector < xercesc::DOMElement * > | FindElements (xercesc::DOMElement *pContextElement, const std::string &rPath) |
static void | FindElements (xercesc::DOMElement *pContextElement, const std::vector< std::string > &rNames, std::vector< xercesc::DOMElement * > &rResults, unsigned depth=0) |
Definition at line 133 of file HeartConfig.cpp.
xsd::cxx::xml::dom::auto_ptr< xercesc::DOMDocument > XmlTools::ReadFileToDomDocument | ( | const std::string & | rFileName, | |
::xml_schema::error_handler & | rErrorHandler, | |||
const ::xml_schema::properties & | rProps | |||
) | [static] |
Read an XML file into a DOM document. Useful for figuring out what version of the parameters file we're dealing with, so we can construct the right version of the object model.
Requires the Xerces runtime to have been initialised.
rFileName | the file to read | |
rErrorHandler | handler for any parsing errors | |
rProps | properties that specify fixed schema locations, if wanted |
Definition at line 2883 of file HeartConfig.cpp.
Referenced by HeartConfig::ReadFile().
void XmlTools::PrintNode | ( | const std::string & | rMsg, | |
xercesc::DOMNode * | pNode, | |||
bool | showChildren = false | |||
) | [static] |
Display key info about an XML node for debugging.
rMsg | message to prepend to the report | |
pNode | the node to display | |
showChildren | whether to recursive display the node's children |
Definition at line 2996 of file HeartConfig.cpp.
xercesc::DOMElement * XmlTools::SetNamespace | ( | xercesc::DOMDocument * | pDocument, | |
xercesc::DOMElement * | pElement, | |||
const std::string & | rNamespace | |||
) | [static] |
Fake having a namespace in older configuration files, by setting the namespace on each element in a tree.
pDocument | the DOM document containing the tree to be transformed | |
pElement | the root of the tree to be transformed | |
rNamespace | the namespace to put elements in |
Definition at line 3073 of file HeartConfig.cpp.
Referenced by HeartConfig::ReadFile(), and SetNamespace().
xercesc::DOMElement * XmlTools::SetNamespace | ( | xercesc::DOMDocument * | pDocument, | |
xercesc::DOMElement * | pElement, | |||
const XMLCh * | pNamespace | |||
) | [static] |
Fake having a namespace in older configuration files, by setting the namespace on each element in a tree.
pDocument | the DOM document containing the tree to be transformed | |
pElement | the root of the tree to be transformed | |
pNamespace | the namespace to put elements in |
Definition at line 3025 of file HeartConfig.cpp.
References SetNamespace().
void XmlTools::WrapContentInElement | ( | xercesc::DOMDocument * | pDocument, | |
xercesc::DOMElement * | pElement, | |||
const XMLCh * | pNewElementLocalName | |||
) | [static] |
Wrap the content (children) of an element within a new element. The new element becomes the sole child of the original element.
pDocument | the DOM document containing the tree to be transformed | |
pElement | the element whose content is to be wrapped | |
pNewElementLocalName | the local name (i.e. without namespace prefix) of the wrapping element (the namespace of pElement will be used). |
Definition at line 3125 of file HeartConfig.cpp.
Referenced by XmlTransforms::TransformIonicModelDefinitions().
std::vector< xercesc::DOMElement * > XmlTools::FindElements | ( | xercesc::DOMElement * | pContextElement, | |
const std::string & | rPath | |||
) | [static] |
Find all elements matching the given path from this context element.
pContextElement | the root element to search from | |
rPath | where to search. This should be a '/'-separated path of element names. |
Definition at line 3101 of file HeartConfig.cpp.
Referenced by XmlTransforms::CheckForIluPreconditioner(), FindElements(), XmlTransforms::TransformArchiveDirectory(), and XmlTransforms::TransformIonicModelDefinitions().
void XmlTools::FindElements | ( | xercesc::DOMElement * | pContextElement, | |
const std::vector< std::string > & | rNames, | |||
std::vector< xercesc::DOMElement * > & | rResults, | |||
unsigned | depth = 0 | |||
) | [static] |
Find all elements matching the given path from this context element.
pContextElement | the root element to search from | |
rNames | a list of element names, the first of which is looked for as children of pContextElement; the next as children of those, etc. | |
rResults | vector to be filled in with matching elements | |
depth | for managing recursion; should not be provided by users |
Definition at line 3080 of file HeartConfig.cpp.
References FindElements().