Added a hack to use the tag's namespace as the default namespace in the lack of any other information. Not sure if this is correct.

This commit is contained in:
waterson%netscape.com 1999-02-17 23:41:23 +00:00
parent 4e6d046d98
commit c7aaa78312

View File

@ -1025,6 +1025,22 @@ XULContentSinkImpl::AddAttributes(const nsIParserNode& aNode,
v = aNode.GetValueAt(i);
nsRDFParserUtils::StripAndConvert(v);
#define USE_TAG_NAMESPACE_AS_DEFAULT_NAMESPACE
#ifdef USE_TAG_NAMESPACE_AS_DEFAULT_NAMESPACE
// XXX This is a hack that I'm not sure is legal: as a last
// ditch effort, we treat attributes with an unknown (or no)
// namespace as being in the same namespace as the tag itself.
if ((nameSpaceID == kNameSpaceID_Unknown) ||
(nameSpaceID == kNameSpaceID_None)) {
nsAutoString tag = aNode.GetText();
nsIAtom* prefix = CutNameSpacePrefix(tag);
if (prefix) {
nameSpaceID = GetNameSpaceID(prefix);
NS_RELEASE(prefix);
}
}
#endif
// Get the URI for the namespace, so we can construct a
// fully-qualified property name.
mNameSpaceManager->GetNameSpaceURI(nameSpaceID, k);