mount xml files as directory structures
C Shell
Switch branches/tags
Latest commit 8ed755a Nov 2, 2010 @halhen halhen Add makedepends git
Permalink
Failed to load latest commit information.
dist/archlinux Add makedepends git Nov 2, 2010
LICENSE
Makefile * install / uninstall targets for Makefile Apr 23, 2009
README.md Put all documentation in README.md Nov 1, 2010
config.mk * install / uninstall targets for Makefile Apr 23, 2009
global.h Better Makefile. Took care of warnings. Fixed some memory leaks. Apr 23, 2009
main.c Missed setting version number in main.c. Now 0.1.1 Nov 1, 2010
test.sh Unit tests reverted to use root node in the top level directory. Apr 23, 2009
test.xml Initial git-hub commit. Currently handles nodes to directories, attri… Apr 23, 2009
xmlhelpers.c New home, and new version Nov 1, 2010
xmlhelpers.h New home, and new version Nov 1, 2010

README.md

xmlfs

xmlfs is an userspace application that lets you represent an XML file as a directory structure for easy access. In this early version, xmlfs only supports read operations. This may be extended in the future.

Distribution specific links:

Representation

  • Nodes are represented as directories.
  • Node attributes are represented as files, named as the attribute and contiaining the value.
  • Node content is available in the #text file.

An example XML file and the corresponding directory structure is shown below.

<root rattr="1">
    <node attribute="attrib_value" />
    <node attribute2="second node" />
    <other attribute="attrib_value" />
    <textcontent>some text</textcontent>
</root>

Example operations:

$ tree
.
`-- 1.root
    |-- 1.node
    |   `-- attribute
    |-- 1.other
    |   `-- attribute
    |-- 1.textcontent
    |   `-- #text
    |-- 2.node
    |   `-- attribute2
    `-- rattr

$ cat 1.root/2.node/attribute2 
second node

$ cat 1.root/1.textcontent/#text 
some text

As you can see in the example, node names are prefix with an index. This is nescessary as an XML node can have many children with the same name.

Installation

xmlfs depends on FUSE 2.6+ and libxml2. Please install this before building xmlfs.

Edit config.mk to match your setup. Next run

$ make

Finally, as root:

# make install

To uninstall, as root:

# make uninstall

Usage

$ mkdir mount_dir/
$ xmlfs -o xmlfile=file.xml mount_dir/

Unmount with $ fusermount -u mount_dir

Fore more information, please run xmlfs --help or have a look at the FUSE wiki.

Limitations

In this early version, xmlfs is a read-only filesystem. Also, it only reads basic XML and usage with non-ASCII characters has not been tested.

Known errors:

  • valgrind reports false free()'s from using xml_rootparent

License

Copyright (c) 2009 Henrik Hallberg halhen@k2h.se. Released under GPL 2, see LICENSE for details. Please report bugs or feature requests by email or at github.