for (; *aAttributes; aAttributes += 2) { nsCOMPtr<nsIAtom> prefix; if (! IsXMLNSDirective(nsDependentString(aAttributes[0]), getter_AddRefs(prefix))) { continue; }  nsAutoString uri(aAttributes[1]); nsRDFParserUtils::StripAndConvert(uri);
if ((nsnull != mNameSpaceStack) && (0 < mNameSpaceStack->Count())) { nameSpace = (nsINameSpace*)mNameSpaceStack->ElementAt(mNameSpaceStack->Count() - 1); NS_ADDREF(nameSpace); } else { mNameSpaceManager->RegisterNameSpace(kRDFNameSpaceURI, mRDFNameSpaceID); mNameSpaceManager->CreateRootNameSpace(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;}