ElementEngine: Java XML Parser, SVG Player  
A small footprint XML parser with source.   A Scalable Vector Graphics (SVG) Player that uses the parser.    
XML Parser:
The following listing creates a new Parser called test from a file called “test.xml.”  Calling getElements creates an enumeration.  Each element is checked to see if it is a Title element.  If it is, the title is printed with a call to getValue.  If the Author element is encountered, a check is made for the wife attribute with a call to hasAttribute.  If hasAttribute is true, then the wife attribute data is printed with a call to getAttribute.

           Parser test = new Parser("test.xml");
           Enumeration e = test.getElements();
           while (e.hasMoreElements()){
              Element elem = (Element) e.nextElement();
               if (elem.getTagName().equals("title")) {
                   System.out.println ( "title " + elem.getValue());
               } // equal title
               if (elem.getTagName().equals("author")) {
                    if (elem.hasAttribute("wife")) {
                            System.out.println ( "wife is  " + elem.getAttribute("wife"));
                    } // has attribute wife
               } // equal author
           } // end while

Download: testelement.jar (5kb)
To run put this jar file in your classpath and use the command:
java com.elementengine.xml.Parser test.xml 

Where test.xml is the name of your xml file.
Alternatively, try    java -cp testelement.jar com.elementengine.xml.Parser test.xml   That will set your classpath to include this jar file. 


SVG Player :
The SVG Player users the Parser to parse and display an SVG file.

Download: testsvg.jar (17kb) 
Note: the parser is included in this jar file

To run put this jar file in your classpath and use the command:  
java com.elementengine.xml.svg.svgImage test.svg  

Where test.svg is the name of your xml file. 


Article on how it works
In this article I will examine a Java XML parser in detail. The parser will be used to parse and display a Scalable Vector Graphic (SVG) file. 

Several things become apparent when using Xerces or other full-featured parsers. There is a large amount of overhead in size and memory.  There is a significant learning curve required to perform basic tasks. 

A stripped down parser may be appropriate to decrease overhead in a small program. It may be appropriate for  "closed" XML systems.  In closed system, XML created by one program is parsed and handled by another.  In that case, the parser does not need to handle every possible scenario. It needs to handle all possible output from program that is creating the XML.  There may be cases where an application specific parser may be the best choice.

Full article
Source:
XML:
Parser.java
Element.java
Utility.java

SVG:
svgImage.java
Group.java
Style.java
Transform.java

Test Files:
stylenest.svg
test_4.svg

Please email if you have any questions or suggestions. I would like your feedback.
Carmen