]> git.phdru.name Git - extfs.d.git/commitdiff
Fix a bug in handling comments
authorOleg Broytman <phd@phdru.name>
Wed, 20 Nov 2013 03:57:01 +0000 (07:57 +0400)
committerOleg Broytman <phd@phdru.name>
Wed, 20 Nov 2013 03:58:32 +0000 (07:58 +0400)
xml
xml-ANNOUNCE

diff --git a/xml b/xml
index 15ef7117f65788269070259e166d9585ada87955..3d40d375e081a976a2b9c55d0572c564223e78f3 100755 (executable)
--- a/xml
+++ b/xml
@@ -21,9 +21,12 @@ comments are represented as text files; attributes are shown in a file named
 deliberately ignore a small chance of newline characters in values); names and
 values are reencoded to the console encoding. Text nodes and comments are
 collected in a file named "text", stripped and reencoded. The filesystem is
 deliberately ignore a small chance of newline characters in values); names and
 values are reencoded to the console encoding. Text nodes and comments are
 collected in a file named "text", stripped and reencoded. The filesystem is
-read-only. ElementTree-based implementation doesn't show namespaces as
-attributes; lxml.etree-based implementation shows namespaces as a separate file
-"namespaces"; every child tag includes its parent's namespaces.
+read-only.
+
+Implementation based on minidom doesn't understand namespaces, it just shows
+them among other attributes. ElementTree-based implementation doesn't show
+namespaces at all. Implementation based on lxml.etree shows namespaces in a
+separate file "namespaces"; every child tag includes its parent's namespaces.
 
 It is useful to have a top-down view on an XML structure but it's especially
 convenient to extract text values from tags. One can get, for example, a
 
 It is useful to have a top-down view on an XML structure but it's especially
 convenient to extract text values from tags. One can get, for example, a
@@ -34,7 +37,7 @@ The VFS was inspired by a FUSE xmlfs: https://github.com/halhen/xmlfs
 
 """
 
 
 """
 
-__version__ = "0.5.0"
+__version__ = "0.5.1"
 __author__ = "Oleg Broytman <phd@phdru.name>"
 __copyright__ = "Copyright (C) 2013 PhiloSoft Design"
 __license__ = "GPL"
 __author__ = "Oleg Broytman <phd@phdru.name>"
 __copyright__ = "Copyright (C) 2013 PhiloSoft Design"
 __license__ = "GPL"
@@ -213,7 +216,7 @@ if use_elementtree or use_lxml:
                 if text: text_accumulator.append(text)
             for element in node:
                 if not self.istag(element):
                 if text: text_accumulator.append(text)
             for element in node:
                 if not self.istag(element):
-                    text = u"<!--%s-->" % text
+                    text = u"<!--%s-->" % element.text
                     text_accumulator.append(text)
             if node.tail:
                 text = node.tail.strip()
                     text_accumulator.append(text)
             if node.tail:
                 text = node.tail.strip()
index e709e532a01b03d5f8cfe38e6efeed1670f7e7c0..263f1d9bb840df4116623b39b67442021406e351 100644 (file)
@@ -5,6 +5,9 @@ WHAT IS IT
    View an XML file in Midnight Commander as a filesystem.
 
 
    View an XML file in Midnight Commander as a filesystem.
 
 
+WHAT'S NEW in version 0.5.1 (2013-11-20)
+   Fixed a bug in handling comments.
+
 WHAT'S NEW in version 0.5.0 (2013-11-19)
    Added lxml.etree-based implementation.
 
 WHAT'S NEW in version 0.5.0 (2013-11-19)
    Added lxml.etree-based implementation.