mNameSpaceStack.AppendElement(nameSpace);
XULContentSinkImpl::PushNameSpacesFrom(const nsIParserNode& aNode){    nsAutoString k, uri, prefix;    PRInt32 ac = aNode.GetAttributeCount();    PRInt32 offset;    nsresult result = NS_OK;    nsINameSpace* nameSpace = nsnull;    if ((nsnull != mNameSpaceStack) && (0 < mNameSpaceStack->Count())) {        nameSpace = (nsINameSpace*)mNameSpaceStack->ElementAt(mNameSpaceStack->Count() - 1);        NS_ADDREF(nameSpace);    }    else {        mNameSpaceManager->CreateRootNameSpace(nameSpace);    }    if (nsnull != nameSpace) {        for (PRInt32 i = 0; i < ac; i++) {            const nsString& key = aNode.GetKeyAt(i);            k.Truncate();            k.Append(key);            // Look for "xmlns" at the start of the attribute name            offset = k.Find(kNameSpaceDef);            if (0 == offset) {                prefix.Truncate();                if (k.Length() >= sizeof(kNameSpaceDef)) {                    // If the next character is a :, there is a namespace prefix                    PRUnichar next = k.CharAt(sizeof(kNameSpaceDef)-1);                    if (':' == next) {                        k.Right(prefix, k.Length()-sizeof(kNameSpaceDef));                    }                    else {                        continue; // it's not "xmlns:"                    }                }                // Get the attribute value (the URI for the namespace)                uri = aNode.GetValueAt(i);                nsRDFParserUtils::StripAndConvert(uri);                // Open a local namespace                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;                }                // XXX I don't think that this is important for XUL,                // since we won't be streaming it back out.                //                 // Add it to the set of namespaces used in the RDF/XML                // document.                //mDataSource->AddNameSpace(prefixAtom, uri);                      NS_IF_RELEASE(prefixAtom);            }        }        // Now push the *last* namespace that we discovered on to the stack.        if (nsnull == mNameSpaceStack) {            mNameSpaceStack = new nsVoidArray();        }        mNameSpaceStack->AppendElement(nameSpace);    }}