From 40c47054deb3742d6bc6d77e64c6fbc445853072 Mon Sep 17 00:00:00 2001 From: "waterson%netscape.com" Date: Mon, 15 May 2000 19:12:14 +0000 Subject: [PATCH] Bug 39305. Do not add 'xmlns=' and 'xmlns:foo=' as properties to the RDF graph. git-svn-id: svn://10.0.0.236/trunk@69816 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/rdf/base/src/nsRDFContentSink.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mozilla/rdf/base/src/nsRDFContentSink.cpp b/mozilla/rdf/base/src/nsRDFContentSink.cpp index 600f58f6873..d1548d8119c 100644 --- a/mozilla/rdf/base/src/nsRDFContentSink.cpp +++ b/mozilla/rdf/base/src/nsRDFContentSink.cpp @@ -202,6 +202,7 @@ public: static nsIAtom* kSeqAtom; static nsIAtom* kAltAtom; static nsIAtom* kLiAtom; + static nsIAtom* kXMLNSAtom; protected: // Text management @@ -290,6 +291,7 @@ nsIAtom* RDFContentSinkImpl::kBagAtom; nsIAtom* RDFContentSinkImpl::kSeqAtom; nsIAtom* RDFContentSinkImpl::kAltAtom; nsIAtom* RDFContentSinkImpl::kLiAtom; +nsIAtom* RDFContentSinkImpl::kXMLNSAtom; //////////////////////////////////////////////////////////////////////// @@ -339,6 +341,7 @@ RDFContentSinkImpl::RDFContentSinkImpl() kSeqAtom = NS_NewAtom("Seq"); kAltAtom = NS_NewAtom("Alt"); kLiAtom = NS_NewAtom("li"); + kXMLNSAtom = NS_NewAtom("xmlns"); } #ifdef PR_LOGGING @@ -429,6 +432,7 @@ RDFContentSinkImpl::~RDFContentSinkImpl() NS_IF_RELEASE(kSeqAtom); NS_IF_RELEASE(kAltAtom); NS_IF_RELEASE(kLiAtom); + NS_IF_RELEASE(kXMLNSAtom); } } @@ -1140,6 +1144,11 @@ RDFContentSinkImpl::AddProperties(const nsIParserNode& aNode, attr.get() == kResourceAtom)) continue; + // skip 'xmlns' directives, these are "meta" information + if ((nameSpaceID == kNameSpaceID_XMLNS) || + (attr.get() == kXMLNSAtom)) + continue; + nsAutoString v(aNode.GetValueAt(i)); nsRDFParserUtils::StripAndConvert(v);