if (uriEnd != aExpatName && aValue && nameSpaceURI.EqualsLiteral("http: nsCOMPtr<nsIAtom> prefix = *aLocalName == kXMLNSAtom ? nsnull : *aLocalName; nsCOMPtr<nsIRDFXMLSink> sink = do_QueryInterface(mDataSource); if (sink) { sink->AddNameSpace(prefix, nsDependentString(aValue)); } }
RDFContentSinkImpl::SplitExpatName(const PRUnichar *aExpatName,                                   nsIAtom **aLocalName,                                   const PRUnichar *aValue){    /**     *  Expat can send the following:     *    localName     *    namespaceURI<separator>localName     *    namespaceURI<separator>localName<separator>prefix     *     *  and we use 0xFFFF for the <separator>.     *     */    const PRUnichar *uriEnd = aExpatName;    const PRUnichar *nameStart = aExpatName;    const PRUnichar *pos;    for (pos = aExpatName; *pos; ++pos) {        if (*pos == 0xFFFF) {            if (uriEnd != aExpatName) {                break;            }            uriEnd = pos;            nameStart = pos + 1;        }    }    const nsDependentSubstring& nameSpaceURI = Substring(aExpatName, uriEnd);    *aLocalName = NS_NewAtom(NS_ConvertUTF16toUTF8(nameStart,                                                   pos - nameStart));    if (uriEnd != aExpatName && aValue &&        nameSpaceURI.EqualsLiteral("http://www.w3.org/2000/xmlns/")) {        nsCOMPtr<nsIAtom> prefix =            *aLocalName == kXMLNSAtom ? nsnull : *aLocalName;        nsCOMPtr<nsIRDFXMLSink> sink = do_QueryInterface(mDataSource);        if (sink) {            sink->AddNameSpace(prefix, nsDependentString(aValue));        }    }    return nameSpaceURI;}