SplitQualifiedName(key, nameSpaceID, attr);
attr = key; nsIAtom* prefix = CutNameSpacePrefix(attr); if (prefix != nsnull) { SplitQualifiedName(key, nameSpaceID, attr); NS_RELEASE(prefix); } else nameSpaceID = kNameSpaceID_None;
XULContentSinkImpl::AddAttributes(const nsIParserNode& aNode,                                  nsIRDFResource* aSubject){    // Add tag attributes to the content attributes    nsAutoString k, v;    nsAutoString attr;    PRInt32 nameSpaceID;    PRInt32 ac = aNode.GetAttributeCount();    for (PRInt32 i = 0; i < ac; i++) {        // Get upper-cased key        const nsString& key = aNode.GetKeyAt(i);        SplitQualifiedName(key, nameSpaceID, attr);        // Don't add xmlns: declarations, these are really just        // processing instructions.        if (nameSpaceID == kNameSpaceID_XMLNS)            continue;        // skip xul:id (and potentially others in the future). These        // are all "special" and should've been dealt with by the        // caller.        if ((nameSpaceID == kNameSpaceID_XUL) &&            (attr.EqualsIgnoreCase(kXULID)))            continue;        v = aNode.GetValueAt(i);        nsRDFParserUtils::StripAndConvert(v);//#define USE_TAG_NAMESPACE_AS_DEFAULT_NAMESPACE#ifdef  USE_TAG_NAMESPACE_AS_DEFAULT_NAMESPACE        // XXX This is a hack that I'm not sure is legal: as a last        // ditch effort, we treat attributes with an unknown (or no)        // namespace as being in the same namespace as the tag itself.        // XXX Note, for this to really work right, you need to make        // sure to do this in GetXULIDAttribute(), too...        if ((nameSpaceID == kNameSpaceID_Unknown) ||            (nameSpaceID == kNameSpaceID_None)) {            nsAutoString tag = aNode.GetText();            nsIAtom* prefix = CutNameSpacePrefix(tag);            if (prefix) {                nameSpaceID = GetNameSpaceID(prefix);                NS_RELEASE(prefix);            }        }#endif        if (nameSpaceID == kNameSpaceID_HTML)            attr.ToLowerCase();        // Get the URI for the namespace, so we can construct a        // fully-qualified property name.        mNameSpaceManager->GetNameSpaceURI(nameSpaceID, k);        // Insert a '#' if the namespace doesn't end with one, or the        // attribute doesn't start with one.        if (! ((attr.First() == '#') &&               (k.Last() == '#' || k.Last() == '/'))) {            k.Append('#');        }        k.Append(attr);        // Add the attribute to RDF        rdf_Assert(mDataSource, aSubject, k, v);    }    return NS_OK;}