nsCOMPtr<nsIRDFXMLSink> sink = do_QueryInterface(mDataSource); if (sink) { sink->AddNameSpace(prefix, uri); } } return NS_OK;
uri = aNode.GetValueAt(i); nsRDFParserUtils::StripAndConvert(uri);   nsIAtom* prefixAtom = ((0 < prefix.Length()) ? NS_NewAtom(prefix) : nsnull); nsINameSpace* child = nsnull; nameSpace->CreateChildNameSpace(prefixAtom, uri, child); if (nsnull != child) { NS_RELEASE(nameSpace); nameSpace = child; }   mDataSource->AddNameSpace(prefixAtom, uri);  NS_IF_RELEASE(prefixAtom); } }   if (nsnull == mNameSpaceStack) { mNameSpaceStack = new nsVoidArray(); } mNameSpaceStack->AppendElement(nameSpace); }
RDFContentSinkImpl::PushNameSpacesFrom(const PRUnichar** aAttributes){  // 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);  for (; *aAttributes; aAttributes += 2) {      nsCOMPtr<nsIAtom> prefix;      if (! IsXMLNSDirective(nsDependentString(aAttributes[0]),                              getter_AddRefs(prefix))) {          continue;      }          nsAutoString uri(aAttributes[1]);      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;}