mbxmlutils
1.3.0
Multi-Body XML Utils
|
Helper class for extending DOMDocument (use the function D(...)). More...
#include <dom.h>
Public Member Functions | |
DOMDocumentWrapper (DOMDocumentType *me_) | |
Wrap DOMDocument to my special element. | |
XercesUniquePtr< xercesc::DOMElement > | validate () |
xercesc::DOMElement * | createElement (const FQN &name) |
std::shared_ptr< DOMParser > | getParser () const |
Get full qualified tag name. | |
boost::filesystem::path | getDocumentFilename () const |
xercesc::DOMNode * | evalRootXPathExpression (std::string xpathExpression, xercesc::DOMElement *context=nullptr) |
xercesc::DOMElement * | locateElement (const std::vector< int > &idx) const |
std::conditional< std::is_same< DOMDocumentType, constxercesc::DOMDocument >::value, constDOMDocumentWrapper *, DOMDocumentWrapper * >::type | operator-> () |
Treat this object as a pointer (like DOMDocument*) | |
Private Attributes | |
DOMDocumentType * | me |
Helper class for extending DOMDocument (use the function D(...)).
xercesc::DOMElement * MBXMLUtils::DOMDocumentWrapper< DOMDocumentType >::createElement | ( | const FQN & | name | ) |
create element with the given FQN Note: a empty namespace (name.first.empty()==true) as no namespace
DOMNode * MBXMLUtils::DOMDocumentWrapper< DOMDocumentType >::evalRootXPathExpression | ( | std::string | xpathExpression, |
xercesc::DOMElement * | context = nullptr |
||
) |
Get the node (DOMElement or DOMAttrType) corresponding the given xpathExpression relative to the root. If context is nullptr than the root element is used. Only a very small subset of XPath is supported by this function: the output of getRootXPathExpression
template path MBXMLUtils::DOMDocumentWrapper< DOMDocumentType >::getDocumentFilename | ( | ) | const |
Get the filename of the document. This is the same as getDocumentURI but with the file schema removed and is a relative path if it was read by a relative path
DOMElement * MBXMLUtils::DOMDocumentWrapper< DOMDocumentType >::locateElement | ( | const std::vector< int > & | idx | ) | const |
Get the element in this document which corresponds to the location idx. idx is usualy retrieved via DOMElementWrapper::getElementLocation().
XercesUniquePtr< DOMElement > MBXMLUtils::DOMDocumentWrapper< DOMDocumentType >::validate |
(re)validate the document using the parser this document was created This will renew ALL nodes in the document. But the old root DOMElement, including all old childrens, will be returned. If you don't use the return value it will be released automatically.