diff --git a/rdf/datasource/src/nsXULContentSink.cpp b/rdf/datasource/src/nsXULContentSink.cpp index 711836afd908..efdeea9df50c 100644 --- a/rdf/datasource/src/nsXULContentSink.cpp +++ b/rdf/datasource/src/nsXULContentSink.cpp @@ -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);