/*
* Copyright 2001-2007 Internet2
- *
+ *
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
/**
* ScopedAttributeDecoder.cpp
- *
+ *
* Decodes SAML into ScopedAttributes
*/
{
public:
ScopedAttributeDecoder(const DOMElement* e) : AttributeDecoder(e), m_delimeter('@') {
- if (e) {
- if (e->hasAttributeNS(NULL,scopeDelimeter)) {
- auto_ptr_char d(e->getAttributeNS(NULL,scopeDelimeter));
- m_delimeter = *(d.get());
- }
+ if (e && e->hasAttributeNS(NULL,scopeDelimeter)) {
+ auto_ptr_char d(e->getAttributeNS(NULL,scopeDelimeter));
+ m_delimeter = *(d.get());
}
}
~ScopedAttributeDecoder() {}
vector< pair<string,string> >& dest = scoped->getValues();
vector<XMLObject*>::const_iterator v,stop;
- Category& log = Category::getInstance(SHIBSP_LOGCAT".AttributeDecoder");
-
+ Category& log = Category::getInstance(SHIBSP_LOGCAT".AttributeDecoder.Scoped");
+
if (xmlObject && XMLString::equals(opensaml::saml1::Attribute::LOCAL_NAME,xmlObject->getElementQName().getLocalPart())) {
const opensaml::saml2::Attribute* saml2attr = dynamic_cast<const opensaml::saml2::Attribute*>(xmlObject);
if (saml2attr) {
val = toUTF8((*v)->getTextContent());
if (val && *val) {
const AttributeExtensibleXMLObject* aexo=dynamic_cast<const AttributeExtensibleXMLObject*>(*v);
- xmlscope = aexo->getAttribute(scopeqname);
+ xmlscope = aexo ? aexo->getAttribute(scopeqname) : NULL;
if (xmlscope && *xmlscope) {
scope = toUTF8(xmlscope);
dest.push_back(pair<string,string>(val,scope));