--- notation3.py.dist	Sun Oct 17 14:50:50 2004
+++ notation3.py	Sun Oct 17 14:50:54 2004
@@ -1028,6 +1028,11 @@
             if a == "xmlns": self.currentNS = v
         if ns != self.currentNS:
             if prefix == ":::" or not prefix:  # Can't trust stored null prefix
+	        _ns = ns[:-1]
+	        for pfx in prefixes.keys() :
+		    if prefixes[pfx] == _ns :
+		       ns = pfx[1]
+		       break
                 attrs = [('xmlns', ns)]
                 self.currentNS = ns
             else:


