Update ctors to use new attribute shortcuts.
[shibboleth/cpp-opensaml.git] / saml / saml2 / binding / impl / SAML2POSTEncoder.cpp
index d38d8b5..ec32ac2 100644 (file)
@@ -87,13 +87,9 @@ namespace opensaml {
 
 static const XMLCh _template[] = UNICODE_LITERAL_8(t,e,m,p,l,a,t,e);
 
-SAML2POSTEncoder::SAML2POSTEncoder(const DOMElement* e, const XMLCh* ns, bool simple) : m_simple(simple)
+SAML2POSTEncoder::SAML2POSTEncoder(const DOMElement* e, const XMLCh* ns, bool simple)
+    : m_template(XMLHelper::getAttrString(e, nullptr, _template, ns)), m_simple(simple)
 {
-    if (e) {
-        auto_ptr_char t(e->getAttributeNS(ns, _template));
-        if (t.get() && *t.get())
-            m_template = t.get();
-    }
     if (m_template.empty())
         throw XMLToolingException("SAML2POSTEncoder requires template XML attribute.");
     XMLToolingConfig::getConfig().getPathResolver()->resolve(m_template, PathResolver::XMLTOOLING_CFG_FILE);