From a662c947557131136248353868eb09272d802b67 Mon Sep 17 00:00:00 2001 From: Andre Sailer <andre.philippe.sailer@cern.ch> Date: Fri, 25 Jul 2014 09:31:28 +0000 Subject: [PATCH] Add attr function for xercesc use, so that char arrays can be used to get xml elements (e.g., necessary to use ddsim w/ xercesc) --- DDCore/include/XML/XMLElements.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/DDCore/include/XML/XMLElements.h b/DDCore/include/XML/XMLElements.h index 7c443d230..1102516db 100644 --- a/DDCore/include/XML/XMLElements.h +++ b/DDCore/include/XML/XMLElements.h @@ -693,6 +693,12 @@ namespace DD4hep { template <class T> T attr(const XmlChar* tag) const { return m_element.attr<T>(tag); } +#ifndef __TIXML__ + /// Access typed attribute value by it's name + template <class T> T attr(const char* name) const { + return this->attr<T>(Strng_t(name)); + } +#endif /// Access attribute name (throws exception if not present) const XmlChar* attr_name(const Attribute attr) const { return m_element.attr_name(attr); -- GitLab