Virtual Filesystems Are Virtual Office Documents

Use libferris, XML and XSLT to create virtual filesystems and virtual documents.

Things become more interesting when we provide a reverse stylesheet, as shown in Listing 5. In this case, we are mapping things back fairly plainly to where they originated in the input filesystem. The file7 content is placed back into the myattr XML attribute of the input document. Having an explicit reverse XSL transform provides you with the freedom to update only part of the original filesystem as you see fit. You also can use functions from the stylesheet to modify the data on its way back to the input filesystem.

Now that we have the forward and reverse XSL, we can happily modify the contents of the original example.xml file by interacting with the virtual file(s) in our xslfs://, as shown in Listing 6.

The example in Listing 6 shows two options for updating your filesystem: either by changing individual virtual files or by updating the virtual XML document (the translated filesystem) in a single shot. The first method of updating individual files maintains the filesystem metaphor in the xsltfs. The second method of updating via rewriting the main virtual XML document provides support for XML editing applications, such as where a document is read, manipulated and rewritten.

The URLs can be quite ugly and rather long. If you are editing such filesystems frequently, you might want to expose the xsltfs using FUSE. Editing virtual XML files with requires the use of FUSE to expose the virtual XML file through the Linux kernel.

Virtual Office Documents

If the format of the output of xsltfs:// is well known, such as an document, you can create file format automatically from the XSL files.

The ferris-filesystem-to-xsltfs-sheets client is used to set up stylesheets automatically. A plugin system is used to allow new file formats to be supported in the future. To see which plugins are available, use the --plugin=help command-line option.

You need to use a FUSE filesystem in order to read and write virtual office documents directly. This also can be set up automatically by the ferris-filesystem-to-xsltfs-sheets client using the --fuse=foo command-line option.

Some distributions require additional setup for a user in order to use FUSE mounts. On Fedora Core, you have to add the user to the fuse group, which can be done as shown in Listing 7.



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Reverse stylesheet

Virtual Office's picture

Interesting, a great read Ben!
Using an explicit reverse makes updating a breeze! I like how you are able to modify the data on it's way back.

Just wondering, how do you find OpenOffice compared to other open source virtual office apps?