[sysadmin-bin: 123/168] Fix problem with left-over nodes at the toplevel.



commit 3270381cf9aff4d95f263cf121e081530edf8eb3
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Wed Jul 29 17:29:15 2009 -0400

    Fix problem with left-over nodes at the toplevel.
    
    If we finish a node at the toplevel, then it shouldn't be saved to
    be added to the enclosing property node - there is no enclosing
    property node.

 semi_rdf.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/semi_rdf.py b/semi_rdf.py
index fc91c5c..d294b3e 100755
--- a/semi_rdf.py
+++ b/semi_rdf.py
@@ -129,7 +129,8 @@ class RdfHandler(xml.sax.handler.ContentHandler):
 
     def popNode(self):
         node = self.__node_stack.pop()
-        self.__object = node
+        if self.__property_stack:
+            self.__object = node
         self.nodes.append(node)
         return node
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]