Support for application-specific attribute IDs.
[shibboleth/sp.git] / shibsp / attribute / resolver / impl / SimpleAttributeResolver.cpp
index 2745e6a..b09b71b 100644 (file)
@@ -596,15 +596,15 @@ void SimpleResolverImpl::populateQuery(saml1p::AttributeQuery& query, const stri
         if (i->second.second == id) {\r
             AttributeDesignator* a = AttributeDesignatorBuilder::buildAttributeDesignator();\r
 #ifdef HAVE_GOOD_STL\r
-            a->setAttributeName(i->first.second.c_str());\r
-            a->setAttributeNamespace(i->first.first.empty() ? shibspconstants::SHIB1_ATTRIBUTE_NAMESPACE_URI : i->first.first.c_str());\r
+            a->setAttributeName(i->first.first.c_str());\r
+            a->setAttributeNamespace(i->first.second.empty() ? shibspconstants::SHIB1_ATTRIBUTE_NAMESPACE_URI : i->first.second.c_str());\r
 #else\r
-            auto_ptr_XMLCh n(i->first.second);\r
+            auto_ptr_XMLCh n(i->first.first.c_str());\r
             a->setAttributeName(n.get());\r
-            if (i->first.first.empty())\r
+            if (i->first.second.empty())\r
                 a->setAttributeNamespace(shibspconstants::SHIB1_ATTRIBUTE_NAMESPACE_URI);\r
             else {\r
-                auto_ptr_XMLCh ns(i->first.first);\r
+                auto_ptr_XMLCh ns(i->first.second.c_str());\r
                 a->setAttributeNamespace(ns.get());\r
             }\r
 #endif\r
@@ -713,15 +713,15 @@ void SimpleResolverImpl::populateQuery(saml2p::AttributeQuery& query, const stri
         if (i->second.second == id) {\r
             saml2::Attribute* a = saml2::AttributeBuilder::buildAttribute();\r
 #ifdef HAVE_GOOD_STL\r
-            a->setName(i->first.second.c_str());\r
-            a->setNameFormat(i->first.first.empty() ? saml2::Attribute::URI_REFERENCE : i->first.first.c_str());\r
+            a->setName(i->first.first.c_str());\r
+            a->setNameFormat(i->first.second.empty() ? saml2::Attribute::URI_REFERENCE : i->first.second.c_str());\r
 #else\r
-            auto_ptr_XMLCh n(i->first.second);\r
+            auto_ptr_XMLCh n(i->first.first.c_str());\r
             a->setName(n.get());\r
-            if (i->first.first.empty())\r
+            if (i->first.second.empty())\r
                 a->setNameFormat(saml2::Attribute::URI_REFERENCE);\r
             else {\r
-                auto_ptr_XMLCh ns(i->first.first);\r
+                auto_ptr_XMLCh ns(i->first.second.c_str());\r
                 a->setNameFormat(ns.get());\r
             }\r
 #endif\r