The script requires Midnight Commander 3.1+
(http://www.midnight-commander.org/), Python 2.4+ (http://www.python.org/).
-For mc 4.7+ put the script in $HOME/[.local/share/].mc/extfs.d.
+For mc 4.7+ just put the script in $HOME/[.local/share/].mc/extfs.d.
For older versions put it in /usr/[local/][lib|share]/mc/extfs
and add a line "xml" to the /usr/[local/][lib|share]/mc/extfs/extfs.ini.
Make the script executable.
For mc 4.7+ run this "cd" command in the Midnight Commander (in the "bindings"
-file the command is "%cd"): cd file/xml://; In older versions it is
+file the command is "%cd"): cd file/xml://; in older versions it is
cd file#xml, where "file" is the name of your XML file.
The VFS represents tags as directories; the directories are numbered to
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
"""
-__version__ = "0.5.0"
+__version__ = "0.5.1"
__author__ = "Oleg Broytman <phd@phdru.name>"
__copyright__ = "Copyright (C) 2013 PhiloSoft Design"
__license__ = "GPL"
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()