return NS_OK;
if (nsnull != ns) { for (PRInt32 i = 0; i < ac; i++) { const nsString& key = aNode.GetKeyAt(i); k.Truncate(); k.Append(key);  offset = k.Find(kNameSpaceDef); if (0 == offset) { prefix.Truncate();  if (k.Length() >= PRInt32(sizeof kNameSpaceDef)) {  PRUnichar next = k.CharAt(sizeof(kNameSpaceDef)-1); if (':' == next) { k.Right(prefix, k.Length()-sizeof(kNameSpaceDef)); } else { continue; } }   uri.Assign(aNode.GetValueAt(i)); nsRDFParserUtils::StripAndConvert(uri);   nsIAtom* prefixAtom = ((0 < prefix.Length()) ? NS_NewAtom(prefix) : nsnull); nsINameSpace* child = nsnull; ns->CreateChildNameSpace(prefixAtom, uri, child); if (nsnull != child) { NS_RELEASE(ns); ns = child; }   nsCOMPtr<nsIRDFXMLSink> sink = do_QueryInterface(mDataSource); if (sink) sink->AddNameSpace(prefixAtom, uri);  NS_IF_RELEASE(prefixAtom); } }   if (nsnull == mNameSpaceStack) { mNameSpaceStack = new nsVoidArray(); } mNameSpaceStack->AppendElement(ns); }
RDFContentSinkImpl::PushNameSpacesFrom(const nsIParserNode& aNode){    // Remember the current top of the stack as the namespace    // scope. When popping namespaces, we'll remove stack elements    // until we hit this.    mNameSpaceScopes.AppendElement(mNameSpaceStack);    PRInt32 count = aNode.GetAttributeCount();    for (PRInt32 i = 0; i < count; ++i) {        const nsAReadableString& key = aNode.GetKeyAt(i);        nsCOMPtr<nsIAtom> prefix;        if (! IsXMLNSDirective(key, getter_AddRefs(prefix)))            continue;        nsAutoString uri(aNode.GetValueAt(i));        nsRDFParserUtils::StripAndConvert(uri);        // Open a local namespace        NameSpaceEntry* ns = new NameSpaceEntry(prefix, NS_ConvertUCS2toUTF8(uri).get());        if (! ns)            return NS_ERROR_OUT_OF_MEMORY;        ns->mNext = mNameSpaceStack;        mNameSpaceStack = ns;        // Add it to the set of namespaces used in the RDF/XML document.        nsCOMPtr<nsIRDFXMLSink> sink = do_QueryInterface(mDataSource);        if (sink)            sink->AddNameSpace(prefix, uri);    }    return NS_OK;}