added code to ignore unknown namespace prefix for attributes

(actually the parser should've rejected it before here)
This commit is contained in:
peterl%netscape.com 1999-06-10 05:33:47 +00:00
Родитель 7687bd0106
Коммит 903764ae77
2 изменённых файлов: 8 добавлений и 8 удалений

Просмотреть файл

@ -458,14 +458,14 @@ nsXMLContentSink::AddAttributes(const nsIParserNode& aNode,
nsIAtom* nameSpacePrefix = CutNameSpacePrefix(name);
nsIAtom* nameAtom = NS_NewAtom(name);
PRInt32 nameSpaceID = (nsnull == nameSpacePrefix) ? kNameSpaceID_None : GetNameSpaceId(nameSpacePrefix);
if (kNameSpaceID_Unknown == nameSpaceID) {
nameSpaceID = kNameSpaceID_None; // XXX is this correct? or is it a bad document?
}
if ((kNameSpaceID_XMLNS == nameSpaceID) && aIsHTML) {
NS_RELEASE(nameAtom);
name.Insert("xmlns:", 0);
nameAtom = NS_NewAtom(name);
nameSpaceID = kNameSpaceID_HTML;
}
else if ((kNameSpaceID_None == nameSpaceID) && aIsHTML) {
nameSpaceID = kNameSpaceID_HTML;
nameSpaceID = kNameSpaceID_HTML; // XXX this is wrong, but necessary until HTML can store other namespaces for attrs
}
nsAutoString value;

Просмотреть файл

@ -458,14 +458,14 @@ nsXMLContentSink::AddAttributes(const nsIParserNode& aNode,
nsIAtom* nameSpacePrefix = CutNameSpacePrefix(name);
nsIAtom* nameAtom = NS_NewAtom(name);
PRInt32 nameSpaceID = (nsnull == nameSpacePrefix) ? kNameSpaceID_None : GetNameSpaceId(nameSpacePrefix);
if (kNameSpaceID_Unknown == nameSpaceID) {
nameSpaceID = kNameSpaceID_None; // XXX is this correct? or is it a bad document?
}
if ((kNameSpaceID_XMLNS == nameSpaceID) && aIsHTML) {
NS_RELEASE(nameAtom);
name.Insert("xmlns:", 0);
nameAtom = NS_NewAtom(name);
nameSpaceID = kNameSpaceID_HTML;
}
else if ((kNameSpaceID_None == nameSpaceID) && aIsHTML) {
nameSpaceID = kNameSpaceID_HTML;
nameSpaceID = kNameSpaceID_HTML; // XXX this is wrong, but necessary until HTML can store other namespaces for attrs
}
nsAutoString value;