X-Git-Url: http://www.project-moonshot.org/gitweb/?p=shibboleth%2Fcpp-xmltooling.git;a=blobdiff_plain;f=xmltooling%2Futil%2FXMLHelper.cpp;fp=xmltooling%2Futil%2FXMLHelper.cpp;h=26823958c5d9d4dce3fb3583828f4ba52f3162fd;hp=a270de4edcabc187ae18b723cbc9cf472eff501c;hb=2d795c731e6729309044607154978696a87fd900;hpb=00a533b0daf2f5a4e6380f6e76f6a1fd11cfdffc diff --git a/xmltooling/util/XMLHelper.cpp b/xmltooling/util/XMLHelper.cpp index a270de4..2682395 100644 --- a/xmltooling/util/XMLHelper.cpp +++ b/xmltooling/util/XMLHelper.cpp @@ -338,9 +338,11 @@ int XMLHelper::getAttrInt(const DOMElement* e, int defValue, const XMLCh* localN if (e) { const XMLCh* val = e->getAttributeNS(ns, localName); if (val && *val) { - int i = XMLString::parseInt(val); - if (i) - return i; + try { + return XMLString::parseInt(val); + } + catch (XMLException&) { + } } } return defValue;