Implementing createElementNS().
git-svn-id: svn://10.0.0.236/trunk@69701 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -772,8 +772,34 @@ nsXMLDocument::CreateElementNS(const nsString& aNamespaceURI,
|
||||
const nsString& aQualifiedName,
|
||||
nsIDOMElement** aReturn)
|
||||
{
|
||||
NS_NOTYETIMPLEMENTED("write me");
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
nsCOMPtr<nsINodeInfo> nodeInfo;
|
||||
rv = mNodeInfoManager->GetNodeInfo(aQualifiedName, aNamespaceURI,
|
||||
*getter_AddRefs(nodeInfo));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
PRInt32 namespaceID;
|
||||
nodeInfo->GetNamespaceID(namespaceID);
|
||||
|
||||
nsIContent* content;
|
||||
if (namespaceID == kNameSpaceID_HTML) {
|
||||
nsIHTMLContent* htmlContent;
|
||||
|
||||
rv = NS_CreateHTMLElement(&htmlContent, nodeInfo);
|
||||
content = (nsIContent*)htmlContent;
|
||||
}
|
||||
else {
|
||||
nsIXMLContent* xmlContent;
|
||||
rv = NS_NewXMLElement(&xmlContent, nodeInfo);
|
||||
content = NS_STATIC_CAST(nsIXMLContent *, xmlContent);
|
||||
}
|
||||
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
content->SetContentID(mNextContentID++);
|
||||
|
||||
return content->QueryInterface(kIDOMElementIID, (void**)aReturn);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
||||
Reference in New Issue
Block a user