Archive for January, 2010

Important: This version is not the official release by the original author of NanoXML (http://nanoxml.cyberelf.be/). It appears that the development for NanoXML has ceased.

Issue in NanoXML

Back in 2008, a version of NanoXML v2.2.4 is “unofficial” released to add comment feature (Javalobby mirror). However, there is one problem that persists which prevent developers from using NanoXML to manipulate xml file. The developers might use xml file for to store profile for their application and will need to manage xml file (etc delete, rename, add). However, it turns out that NanoXML is locking the xml file while waiting for the Garbage Collector to kick in and release the file. However the GC is behaving unpredictably and might not release the file as and when the program expects it. The developers will thus want more control over the release of file resource. Unfortunately, there is currently no API to force release of file resource under current release.

NanoXML v2.2.5

Therefore, I have modified NanoXML and released it as  NanoXML v2.2.5 to allow developers to use a specific method to release file resource manually so that the file can be manipulated (etc delete, rename).

  • public void close()
    This will release all file resource that are held up by Reader.

The aforementioned method will release the file resource that is created using the static method IXMLReader fileReader(String filename) in StdXMLReader class.


public class XmlTest

// ## means new features added.

    public static void main(String[] _args) throws Exception
        IXMLParser parser = XMLParserFactory.createDefaultXMLParser();

        /*// If pass string, use stringReader
        IXMLReader reader = StdXMLReader.stringReader(“<root></root>”);
        // Pass by file. Important to use toURL method otherwise exception will be thrown.
        IXMLReader reader = StdXMLReader.fileReader(
                new File(“c:/test.xml”).toURI().getPath());

        // parse() method does not include comment
        IXMLElement xml = (IXMLElement) parser.parse(true);   // ## true means parse comment too

        IXMLElement _x = xml.createElement(“newChild”);
        _x.setComment(“This is new child”); // ## Adding comment
        _x.setAttribute(“att1″, “me1″);
        _x.setAttribute(“att2″, “me2″);
        xml.addChild(_x, 0);  // ## Adding at specific position.

        IXMLElement _b = xml.getChildAtIndex(1);
        xml.removeChild(_b);  // Remove tag

        XMLWriter writer = new XMLWriter(System.out);
        // Default for write is excluded comment
        writer.setIncludeComment(true); // ## Include comment at generation.
        writer.write(xml, true);





Download NanoXML v2.2.5

The following file contains the full source code and the library jar file. To check on those changes that I have made, you can search for ‘GeekyCoder’ in the source code.

NanoXML-2.2.5.zip (93kb)

Released on 6 Feb 2010


Read Full Post »

Experimenting with “Office 2007” Zoom interface


I have to admit that I like the Default FullZoom Level extension which significantly improve on the FireFox’s rudimentary Zoom feature.


Read Full Post »

imageI am always fascinated by Japan’s history and culture. Not only is the country beautiful, but its historical culture is full of vibrancy and elegance. The author image of this blog (wonder if she is a Japanese) talks everything about Japan, visits the heritage site and narrates the history of events, all accompany by abundance of well-captured photos. Better still, you don’t need to learn Japanese because the blog is written in English. So for those who is interested to find out more about Japan yet without burning your pocket, this site is must-visited site.

Pictureimage, Food image  , building image   , relics  , history image, scenery image . This site has it all (http://mananya.jugem.jp/).

Japan is really a fairy tale to me. Look like I need to start saving up to visit this mystical land one day.

imageTaken from http://1.bp.blogspot.com

Read Full Post »

The following Software and settings are tested on Windows 7. It will also work on Windows XP, Vista.


Okay, I understand your frustration of having to read those CHM Help (** CHM refers to format whereas CHM HELP refers to the standalone Help Viewer) that doesn’t offer control over the text sizeimage. It can be torturous and straining to read ant-like text in high resolution screen. There is really a ton of CHM Help out in wilderness that doesn’t have a Font option to control the text size. I baffled me what is in the mind of those CHM producers who couldn’t add the Font option image  to enhance readability as the CHM is supposed to be ubiquitous distributed format that as common as PDF and to be readable over many types of screen, big and small alike.

Despite the PDF been the de facto standard for document distribution, CHM is still a widely popular format due to its simplicity, size, performance and speedy search capability. Unfortunately there is no way to add a Font options in existing CHM Help unless you want to decompile the CHM and regenerate the CHM, which by no mean a trivial effort.


Read Full Post »