|
DD4hep
1.30.0
Detector Description Toolkit for High Energy Physics
|
Go to the documentation of this file.
15 #ifdef DD4HEP_USE_TINYXML
18 #include <xercesc/util/Xerces_autoconf_config.hpp>
19 #include <xercesc/util/XMLString.hpp>
20 #include <xercesc/dom/DOMElement.hpp>
21 #include <xercesc/dom/DOMDocument.hpp>
22 #include <xercesc/dom/DOMNodeList.hpp>
23 #include <xercesc/dom/DOM.hpp>
38 static const size_t INVALID_NODE = ~0U;
39 static int s_float_precision = -1;
43 std::pair<int, double>
_toInteger(
const std::string& value);
45 void _toDictionary(
const std::string& name,
const std::string& value,
const std::string& typ);
51 bool s_resolve_environment =
true;
52 std::string _checkEnviron(
const std::string& env) {
53 if ( s_resolve_environment ) {
55 return r.empty() ? env : r;
62 #define _D(x) Xml(x).d
63 #define _E(x) Xml(x).e
64 #define _N(x) Xml(x).n
65 #define _L(x) Xml(x).l
66 #define _XE(x) Xml(x).xe
68 #ifdef DD4HEP_USE_TINYXML
69 #define ELEMENT_NODE_TYPE TiXmlNode::ELEMENT
70 #define getTagName Value
71 #define getTextContent GetText
73 #define getValue Value
74 #define getNodeValue Value
75 #define getNodeType Type
76 #define setNodeValue SetValue
77 #define getParentNode Parent()->ToElement
78 #define getAttributeNode(x) AttributeNode(x)
79 #define appendChild LinkEndChild
80 #define getOwnerDocument GetDocument
81 #define getDocumentElement RootElement
82 #define getDocumentURI Value
86 Xml(
const void* ptr) : p(ptr) {}
96 XmlElement* node_first(XmlElement* e,
const Tag_t& t) {
97 if ( t.
str()==
"*" )
return e ? (XmlElement*)
_E(e)->FirstChildElement() : 0;
98 return e ? (XmlElement*)
_E(e)->FirstChildElement(t.
str()) : 0;
100 size_t node_count(XmlElement* elt,
const Tag_t& t) {
111 return c ? ::strdup(c) : 0;
116 if(p && *p) {::free(*p); *p=0;}
119 return p ? ::strlen(p) : 0;
123 #define ELEMENT_NODE_TYPE xercesc::DOMNode::ELEMENT_NODE
133 xercesc::DOMElement*
e;
134 xercesc::DOMDocument*
d;
135 xercesc::DOMNodeList*
l;
140 return xercesc::XMLString::replicate(c);
143 return xercesc::XMLString::transcode(c);
146 return xercesc::XMLString::transcode(c);
149 return xercesc::XMLString::release(p);
152 return xercesc::XMLString::release(p);
155 return p ? xercesc::XMLString::stringLen(p) : 0;
158 return p ? xercesc::XMLString::stringLen(p) : 0;
162 size_t node_count(XmlElement* e,
const Tag_t& t) {
165 const std::string& tag = t;
166 xercesc::DOMElement *ee =
Xml(e).
e;
168 for(xercesc::DOMElement* elt=ee->getFirstElementChild(); elt; elt=elt->getNextElementSibling()) {
169 if ( elt->getParentNode() == ee ) {
170 std::string child_tag =
_toString(elt->getTagName());
171 if ( tag ==
"*" || child_tag == tag ) ++cnt;
178 XmlElement* node_first(XmlElement* e,
const Tag_t& t) {
180 const std::string& tag = t;
181 xercesc::DOMElement* ee =
Xml(e).
e;
183 for(xercesc::DOMElement* elt=ee->getFirstElementChild(); elt; elt=elt->getNextElementSibling()) {
184 if ( elt->getParentNode() == ee ) {
185 if ( tag ==
"*" )
return _XE(elt);
186 std::string child_tag =
_toString(elt->getTagName());
187 if ( child_tag == tag )
return _XE(elt);
199 std::string tmp(buff == 0 ?
"" : buff);
201 if ( tmp.length()<3 )
return tmp;
202 if ( !(tmp[0] ==
'$' && tmp[1] ==
'{') )
return tmp;
203 tmp = _checkEnviron(tmp);
213 return Xml(a).
a->getValue();
216 int node_type(XmlNode* n) {
return Xml(n).
n->getNodeType();}
223 int tmp = s_float_precision;
224 s_float_precision = precision;
230 return s_float_precision;
240 template <
typename T>
static inline std::string __to_string(T value,
const char* fmt) {
242 ::snprintf(text,
sizeof(text), fmt, value);
248 if ( !s || *s == 0 )
return "";
249 else if ( !(*s ==
'$' && *(s+1) ==
'{') )
return s;
250 return _checkEnviron(s);
255 if ( s.length() < 3 || s[0] !=
'$' )
return s;
256 else if ( !(s[0] ==
'$' && s[1] ==
'{') )
return s;
257 return _checkEnviron(s);
262 return __to_string(
v, fmt);
267 return __to_string(
v, fmt);
272 return __to_string(
v, fmt);
277 return __to_string(
v, fmt);
282 if ( s_float_precision >= 0 ) {
284 ::snprintf(format,
sizeof(format),
"%%.%de", s_float_precision);
285 return __to_string(
v, format);
287 return __to_string(
v, fmt);
292 if ( s_float_precision >= 0 ) {
294 ::snprintf(format,
sizeof(format),
"%%.%de", s_float_precision);
295 return __to_string(
v, format);
297 return __to_string(
v, fmt);
312 return __to_string(
v, fmt);
325 if ( val >= 0 )
return (
unsigned long) val;
327 throw std::runtime_error(
"dd4hep: Severe error during expression evaluation of " + s);
335 return (
unsigned int)
_toULong(value);
341 char c = ::toupper(s[0]);
342 if ( c ==
'T' || c ==
'1' )
return true;
343 if ( c ==
'F' || c ==
'0' )
return false;
344 return _toInt(value) != 0;
380 template <
typename T>
383 const XmlChar* item_value = item;
387 #ifndef DD4HEP_USE_TINYXML
409 bool tmp = s_resolve_environment;
410 s_resolve_environment = new_value;
414 template <
typename B>
415 static inline std::string i_add(
const std::string& a, B b) {
442 std::string res = a.
str() + b;
447 std::string res = a + b.
str();
457 std::string res = a.
str() + b;
461 #ifndef DD4HEP_USE_TINYXML
565 : m_tag(
copy.m_tag), m_node(
copy.m_node), m_ptr(0)
572 : m_tag(tag_value), m_node(node), m_ptr(0)
588 #ifdef DD4HEP_USE_TINYXML
594 for(elt=elt->getNextElementSibling(); elt; elt=elt->getNextElementSibling()) {
596 std::string child_tag =
_toString(elt->getTagName());
605 #ifdef DD4HEP_USE_TINYXML
611 for(elt=elt->getPreviousElementSibling(); elt; elt=elt->getPreviousElementSibling()) {
613 std::string child_tag =
_toString(elt->getTagName());
637 return _E(
m_node)->getTextContent();
648 #ifdef DD4HEP_USE_TINYXML
651 XmlElement* e =
_XE(
_N(
m_node)->Clone()->ToElement());
654 throw std::runtime_error(
"TiXml: Handle_t::clone: Invalid source handle type [No element type].");
659 throw std::runtime_error(
"Xml: Handle_t::clone: Invalid source handle.");
669 return attribute_node(
m_node, tag_value);
679 std::vector < Attribute > attrs;
681 #ifdef DD4HEP_USE_TINYXML
685 xercesc::DOMNamedNodeMap* l =
_E(
m_node)->getAttributes();
686 for (
XmlSize_t i = 0, n = l->getLength(); i < n; ++i) {
687 xercesc::DOMNode* attr_node = l->item(i);
688 attrs.emplace_back(
Attribute(attr_node));
696 size_t n = node_count(
m_node, t);
697 if (n == INVALID_NODE && !throw_exception)
699 else if (n != INVALID_NODE)
701 std::string msg =
"Handle_t::numChildren: ";
703 msg +=
"Element [" +
tag() +
"] has no children of type '" +
_toString(t) +
"'";
705 msg +=
"Element [INVALID] has no children of type '" +
_toString(t) +
"'";
706 throw std::runtime_error(msg);
712 if (e || !throw_exception)
714 std::string msg =
"Handle_t::child: ";
716 msg +=
"Element [" +
tag() +
"] has no child of type '" +
_toString(t) +
"'";
718 msg +=
"Element [INVALID]. Cannot remove child of type: '" +
_toString(t) +
"'";
719 throw std::runtime_error(msg);
733 #ifdef DD4HEP_USE_TINYXML
740 std::string msg =
"Handle_t::remove: ";
742 msg +=
"Element [" +
tag() +
"] has no child of type '" + node.
tag() +
"'";
744 msg +=
"Element [INVALID]. Cannot remove child of type: '" + node.
tag() +
"'";
746 msg +=
"Element [INVALID]. Cannot remove [INVALID] child. Big Shit!!!!";
748 throw std::runtime_error(msg);
753 #ifdef DD4HEP_USE_TINYXML
757 xercesc::DOMElement* e =
_E(
m_node);
758 xercesc::DOMNodeList* l = e->getElementsByTagName(tag_value);
759 for (
XmlSize_t i = 0, n = l->getLength(); i < n; ++i)
760 e->removeChild(l->item(i));
765 return node_first(
m_node, tag_value) != 0;
770 _N(
m_node)->setNodeValue(text_value);
775 #ifdef DD4HEP_USE_TINYXML
776 _N(
m_node)->setNodeValue(text_value.c_str());
784 #ifdef DD4HEP_USE_TINYXML
787 _N(
m_node)->setTextContent(text_value);
793 #ifdef DD4HEP_USE_TINYXML
802 #ifdef DD4HEP_USE_TINYXML
805 xercesc::DOMElement* e =
_E(
m_node);
806 xercesc::DOMNamedNodeMap* l = e->getAttributes();
807 for (
XmlSize_t i = 0, n = l->getLength(); i < n; ++i) {
808 xercesc::DOMAttr* a = (xercesc::DOMAttr*) l->item(i);
809 e->removeAttributeNode(a);
815 #ifdef DD4HEP_USE_TINYXML
825 xercesc::DOMElement* e =
_E(
m_node);
826 xercesc::DOMNamedNodeMap* l = e->getAttributes();
827 for (
XmlSize_t i = 0, len = l->getLength(); i < len; ++i) {
828 xercesc::DOMNode* n = l->item(i);
829 if (n->getNodeType() == xercesc::DOMNode::ATTRIBUTE_NODE) {
830 xercesc::DOMAttr* a = (xercesc::DOMAttr*) n;
831 e->setAttribute(a->getName(), a->getValue());
842 std::string msg =
"Handle_t::attr_ptr: ";
844 msg +=
"Element [" +
tag() +
"] has no attribute of type '" +
_toString(t) +
"'";
846 msg +=
"Element [INVALID] has no attribute of type '" +
_toString(t) +
"'";
847 throw std::runtime_error(msg);
853 return Xml(a).
a->getName();
855 throw std::runtime_error(
"Attempt to access invalid XML attribute object!");
860 return attribute_value(
attr_ptr(attr_tag));
865 return attribute_value(attr_val);
871 return a ? attribute_value(a) : 0;
877 ::snprintf(txt,
sizeof(txt),
"%d", val);
884 ::snprintf(txt,
sizeof(txt),
"%s", val ?
"true" :
"false");
891 ::snprintf(txt,
sizeof(txt),
"%.8e", val);
898 ::snprintf(txt,
sizeof(txt),
"%.8e", val);
907 #ifndef DD4HEP_USE_TINYXML
915 return v ?
setAttr(nam, attribute_value(
v)) : 0;
920 #ifdef DD4HEP_USE_TINYXML
925 xercesc::DOMElement* e =
_E(
m_node);
926 xercesc::DOMAttr* a = e->getAttributeNode(nam);
928 a = e->getOwnerDocument()->createAttribute(nam);
929 e->setAttributeNode(a);
940 ref.
setAttr(Unicode_ref, ref_name);
951 static unsigned int adler32(
unsigned int adler,
const XmlChar* xml_buff,
size_t len) {
952 #define DO1(buf,i) {s1 +=(unsigned char)buf[i]; s2 += s1;}
953 #define DO2(buf,i) DO1(buf,i); DO1(buf,i+1);
954 #define DO4(buf,i) DO2(buf,i); DO2(buf,i+2);
955 #define DO8(buf,i) DO4(buf,i); DO4(buf,i+4);
956 #define DO16(buf) DO8(buf,0); DO8(buf,8);
958 static const unsigned int BASE = 65521;
960 static const unsigned int NMAX = 5550;
961 unsigned int s1 = adler & 0xffff;
962 unsigned int s2 = (adler >> 16) & 0xffff;
963 const char* buf = (
const char*)xml_buff;
969 int k = len < NMAX ? (int) len : NMAX;
978 s1 += (
unsigned char) *buf++;
984 unsigned int result = (s2 << 16) | s1;
991 #ifdef DD4HEP_USE_TINYXML
992 typedef std::map<std::string, std::string> StringMap;
995 if ( 0 == fcn ) fcn = adler32;
998 std::map<std::string,std::string> m;
1002 param = (*fcn)(param,e->
Value(),::strlen(e->
Value()));
1003 for(StringMap::const_iterator i=m.begin();i!=m.end();++i) {
1004 param = (*fcn)(param,(*i).first.c_str(),(*i).first.length());
1005 param = (*fcn)(param,(*i).second.c_str(),(*i).second.length());
1023 if ( 0 == fcn ) fcn = adler32;
1032 #ifdef DD4HEP_USE_TINYXML
1035 return _XE(
_D(
m_doc)->createElement(tag_value));
1043 throw std::runtime_error(
"Document::root: Invalid handle!");
1052 throw std::runtime_error(
"Document::uri: Invalid handle!");
1058 printout(DEBUG,
"DocumentHolder",
"+++ Release DOM document....");
1059 #ifdef DD4HEP_USE_TINYXML
1076 : m_element(
Xml(doc.createElt(type)).xe) {
1098 throw std::runtime_error(
"Element::clone: Invalid element pointer -- unable to clone node!");
1133 #ifndef DD4HEP_USE_TINYXML
1142 #ifdef DD4HEP_USE_TINYXML
1168 :
Element(e), m_name(e.m_name) {
1179 std::cout <<
"Error:tag=" <<
m_element.
tag() << std::endl;
1180 return attribute_value(
m_name);
1185 std::cout <<
"Error:tag=" <<
m_element.
tag() << std::endl;
1186 return attribute_value(
m_name);
1193 #ifndef DD4HEP_USE_TINYXML
1195 : m_children(element, tag_value) {
1201 : m_children(element,
Strng_t(tag_value)) {
1207 : m_children(node_list) {
1225 throw std::runtime_error(std::string(e.what()) +
"\n" +
"dd4hep: Error interpreting XML nodes of type <" +
tag() +
"/>");
1227 throw std::runtime_error(std::string(e.what()) +
"\n" +
"dd4hep: Error interpreting collections XML nodes.");
1261 #ifdef DD4HEP_USE_TINYXML
1268 #ifdef DD4HEP_USE_TINYXML
void throw_loop_exception(const std::exception &e) const
Helper function to throw an exception.
void setValue(const XmlChar *text) const
Set the element's value.
static XmlChar * replicate(const XmlChar *c)
Replicate string: internally allocates new string, which must be free'ed with release.
TinyXML class. See http://www.grinninglizard.com/tinyxml.
Document document() const
Access the hosting document handle of this DOM element.
Class to support the access to collections of XmlNodes (or XmlElements)
Handle_t setChild(const XmlChar *tag) const
Check if a child with the required tag exists - if not create it and add it to the current node.
std::string m_str
STL string buffer.
TinyXML class. See http://www.grinninglizard.com/tinyxml.
const XmlChar * getRef(const XmlChar *tag) const
Access the value of the reference attribute of the node (attribute ref="ref-name")
XmlElement * next() const
Advance to next element.
std::string tag() const
Text access to the element's tag.
std::string uri() const
Acces the document URI.
double _toDouble(const XmlChar *value)
Conversion function from raw unicode string to double.
void setName(const XmlChar *new_name)
Change/set the object's name.
const XmlChar * cpXmlChar
void append(Handle_t handle) const
Append a new element to the existing tree.
NodeList & operator=(const NodeList &l)
Assignment operator.
Helper structure to shortcut type definitions for the factories.
Class describing a list of XML nodes.
Handle_t clone(XmlDocument *new_doc) const
Clone the DOMelement - with the option of a deep copy.
void exception(const std::string &src, const std::string &msg)
unsigned int _toUInt(const XmlChar *value)
Conversion function from raw unicode string to unsigned int.
const XmlChar * attr_value_nothrow(const XmlChar *attr) const
Access attribute value by the attribute's unicode name (no exception thrown if not present)
Handle_t m_element
The underlying object holding the XmlElement pointer.
const XmlAttr * Attribute
XmlElement * previous() const
Go back to previous element.
void _toDictionary(const std::string &name, const std::string &value)
Enter name value pair to the dictionary. "value" must be a numerical expression, which is evaluated.
Handle_t setRef(const XmlChar *tag, const XmlChar *ref)
Add reference child as a new child node. The obj must have the "name" attribute!
void append(Handle_t e) const
Append a DOM element to the current node.
Tag_t & operator=(const char *s)
Assignment of a normal ASCII string.
Handle_t parent() const
Access the element's parent element.
long _toLong(const XmlChar *value)
Conversion function from raw unicode string to long.
Handle_t addChild(const XmlChar *tag) const
Add a new child to the DOM node.
const TiXmlNode * FirstChild() const
The first child of this node. Will be null if there are no children.
unsigned int() fcn_t(unsigned int, const XmlChar *, size_t)
Checksum (sub-)tree of a xml document/tree.
virtual const TiXmlElement * ToElement() const
Cast to a more defined type. Will return null if not of the requested type.
static size_t length(const char *s)
String length in native representation.
Handle_t createElt(const XmlChar *tag) const
Create DOM element.
Handle_t remove(Handle_t e) const
Remove a single child node identified by its handle from the tree of the element.
Class to easily access the properties of single XmlElements.
bool enableEnvironResolution(bool new_value)
Enable/disable environment resolution when parsing strings.
void setAttrs(Handle_t e) const
Set attributes as in argument handle.
Handle_t(Elt_t e=0)
Initializing constructor.
XmlElement * reset()
Reset the nodelist - e.g. restart iteration from beginning.
const char * Value() const
Return the value of this attribute.
void _toDictionary(const XmlChar *name, const XmlChar *value)
Helper function to populate the evaluator dictionary.
~NodeList()
Default destructor.
size_t numChildren(const XmlChar *tag, bool throw_exception) const
Access the number of children of this DOM element with a given tag name.
Handle_t::Elt_t Elt_t
Simplification type declarations.
const XmlChar * attr_name(const Attribute attr) const
Access attribute name (throws exception if not present)
NodeList(const NodeList &l)
Copy constructor.
const XmlChar * rawText() const
Unicode text access to the element's text.
Class to support both way translation between C++ and XML strings.
bool hasChild(const XmlChar *tag) const
Check the existence of a child with a given tag name.
int get_float_precision()
Access floating point precision on conversion to string.
const TiXmlAttribute * FirstAttribute() const
Access the first attribute in this element.
const XmlChar * refName() const
Access the object's reference name in unicode (same as name)
Collection_t & reset()
Reset the collection object to restart the iteration.
void removeChildren(const XmlChar *tag) const
Remove children with a given tag name from the DOM node.
XmlChar * m_xml
Pointer to unicode string.
TinyXML class. See http://www.grinninglizard.com/tinyxml.
const XmlChar * attr_value(const Attribute attr) const
Access attribute value by the attribute (throws exception if not present)
const TiXmlElement * NextSiblingElement() const
Handle_t child(const Strng_t &tag_value, bool except=true) const
Access child by tag name. Thow an exception if required in case the child is not present.
int set_float_precision(int precision)
Change floating point precision on conversion to string.
std::pair< int, double > _toInteger(const std::string &value)
int _toInt(const XmlChar *value)
Conversion function from raw unicode string to int.
virtual ~DocumentHolder()
Standard destructor - releases the document.
Namespace for the AIDA detector description toolkit supporting XML utilities.
Attribute setRef(const XmlChar *tag, const XmlChar *refname) const
Set the reference attribute to the node (adds attribute ref="ref-name")
void SetAttribute(const char *name, const char *_value)
Attribute m_name
Attribute holding thre name.
#define ELEMENT_NODE_TYPE
NodeList children(const XmlChar *tag) const
Access a group of children identified by the same tag name.
const XmlChar * name() const
Access the object's name in unicode.
static void release(char **p)
Release string.
Attribute attr_ptr(const XmlChar *attr) const
Access attribute pointer by the attribute's unicode name (throws exception if not present)
Elt_t ptr() const
Access to XmlElement pointer.
Element(const Handle_t &e)
Constructor from XmlElement handle.
Attribute getAttr(const XmlChar *name) const
Access single attribute by its name.
std::pair< int, double > _toFloatingPoint(const std::string &value)
std::string _toString(const Attribute attr)
Convert xml attribute to STL string.
const TiXmlAttribute * Next() const
Get the next sibling attribute in the DOM. Returns null at end.
static XmlChar * transcode(const char *c)
Transcode string.
std::string _getEnviron(const std::string &env)
Evaluate string constant using environment stored in the evaluator.
Strng_t & operator=(const XmlChar *s)
Assignment opertor from unicode string.
TinyXML class. See http://www.grinninglizard.com/tinyxml.
Helper class to encapsulate a unicode string.
Class supporting the basic functionality of an XML document including ownership.
Handle_t child(const XmlChar *tag, bool throw_exception=true) const
Access a single child by its tag name (unicode)
Handle_t clone(const Document &new_doc) const
Clone the DOMelement.
void setText(const XmlChar *text) const
Set the element's text.
Handle_t clone(Handle_t source) const
Clone a DOM element / sub-tree.
DocumentHolder & assign(DOC d)
Assign new document. Old document is dropped.
Class supporting the basic functionality of an XML document.
const TiXmlElement * FirstChildElement() const
Convenience function to get through elements.
RefElement(const Handle_t &e)
Construction from existing object handle.
Strng_t operator+(const Strng_t &a, const char *b)
Unicode string concatenation of a normal ASCII string from right side.
Elt_t parentElement() const
Access the XmlElements parent.
RefElement & operator=(const RefElement &e)
Assignment operator.
size_t size() const
Access the collection size. Avoid this call – sloooow!
Elt_t m_node
The pointer to the XmlElement.
User abstraction class to manipulate named XML elements (references) within a document.
const XmlChar * ptr() const
Accessor to unicode string.
unsigned long _toULong(const XmlChar *value)
Conversion function from raw unicode string to unsigned long.
const char * Value() const
Collection_t(Handle_t node, const XmlChar *tag)
Constructor over XmlElements with a given tag name.
const XmlChar * rawTag() const
Unicode text access to the element's tag. Tis must be wrong ....
float _toFloat(const XmlChar *value)
Conversion function from raw unicode string to float.
XERCES_XMLCH_T XmlChar
Use the definition from the autoconf header of Xerces:
Union to ease castless object access when using XercesC.
User abstraction class to manipulate XML elements within a document.
Namespace for the AIDA detector description toolkit.
const std::string & str() const
Access writable STL string.
std::vector< Attribute > attributes() const
Retrieve a collection of all attributes of this DOM element.
Attribute setAttr(const XmlChar *nam, const T &val) const
Set single attribute.
std::string _ptrToString(const void *p, const char *fmt="%p")
Format void pointer (64 bits) to string with arbitrary format.
std::string getEnviron(const std::string &env)
Helper function to lookup environment from the expression evaluator.
NodeList m_children
Reference to the list of child nodes.
Attribute setAttr(const XmlChar *t, const XmlChar *v) const
Generic attribute setter with unicode value.
const TiXmlAttribute * AttributeNode(const char *name) const
const char * Name() const
Return the name of this attribute.
unsigned int checksum(unsigned int param, unsigned int(fcn)(unsigned int param, const XmlChar *, size_t)=0) const
Checksum (sub-)tree of a xml document/tree. Default will pick up the adler32 checksum.
bool hasAttr(const XmlChar *t) const
Check for the existence of a named attribute.
virtual const TiXmlText * ToText() const
Cast to a more defined type. Will return null if not of the requested type.
void operator++() const
Operator to advance the collection (pre increment)
const TiXmlNode * NextSibling(const std::string &_value) const
STL std::string form.
const XmlChar * rawValue() const
Unicode text access to the element's value.
TinyXML class. See http://www.grinninglizard.com/tinyxml.
T attr(const Attribute a) const
Access typed attribute value by the XmlAttr.
bool _toBool(const XmlChar *value)
Conversion function from raw unicode string to bool.
Elt_t ptr() const
Direct access to the XmlElement by function.
void operator--() const
Operator to advance the collection (pre decrement)
void removeAttrs() const
Remove all attributes of this element.
void addComment(const XmlChar *text) const
Add comment node to the element.
Attribute attr_nothrow(const XmlChar *tag) const
Access attribute pointer by the attribute's unicode name (no exception thrown if not present)
Handle_t root() const
Access the ROOT eleemnt of the DOM document.