From c7aaa78312f90ec2f37a28bda6e7e999b8e452e8 Mon Sep 17 00:00:00 2001 From: "waterson%netscape.com" Date: Wed, 17 Feb 1999 23:41:23 +0000 Subject: [PATCH] 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. --- rdf/datasource/src/nsXULContentSink.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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);