http://www.cs.helsinki.fi/group/xmltools/
XML Tools
This page briefly documents some of the XML tools used in the XML course. Most of these tools come from the Apache XML Project.
This page is constantly under construction.
Validators
You can use these scripts to check the well-formedness and/or validity of documents. You can run them as
- /home/group/xmltools/bin/check-wf
- /home/group/xmltools/bin/validate
Both take the name of your XML file as an argument. Internally, these scripts use the Xerces parser. Validation works with DTDs and XML Schemas. You can try the following example files.
This online validator may be useful when working "on the road".
- Brown University online validator at http://www.stg.brown.edu/service/xmlvalid/
Note that the DTD must either be included in the document (internal subset) or placed on a publicly accessible web server.
Parsers
Most of the tools on this page use the Xerces parser. Xerces has both DOM and SAX implementations.
Instructions from exercise 3 (year 2006) should perhaps be copied here. (Not needed in 2007.)
XSLT and FO Processors
Version 2.7.0 of Xalan (XSLT processor) and 0.20.5 of FOP (formatting objects processor) have been installed in the xmltools directory. You can run them as follows.
- /home/group/xmltools/bin/xalan
- /home/group/xmltools/bin/fop
[12.2.2007] FOP 0.93 is available as follows.
- /home/group/xmltools/bin/fop-0.93
[11.4.2006] If you have problems with Xalan 2.7.0 you can still use the previous installed version (2.6.0) as follows.
- /home/group/xmltools/bin/xalan.old
There's also version 20051206 of XT (another XSLT implementation) available as follows.
- /home/group/xmltools/bin/xt
[12.4.2006] The previous installed version (20020426a) is available as follows.
- /home/group/xmltools/bin/xt.old
They all produce a short help message if you run them without arguments. The basic usage is as follows.
- Xalan
- xalan -IN xml_file -XSL xslt_file [-OUT output_file]
- FOP (PDF)
- fop fo_xml_file -pdf output_file
- FOP (text)
- fop fo_xml_file -txt output_file
- XT
- xt xml_file xslt_file [output_file]
For documentation, see the Apache/XT websites:
Listed Type 1 fonts installed at the department have been made available to the FOP 0.20.5 installation (when producing PDF). The fop script should be able to pick up the fonts without further work from you. Remember that the Base 14 fonts are always available in PDF.
The FOP 0.93 installation supports a collection of TrueType fonts in addition to the Base 14 fonts. The CID-keyed fonts support a potentially larger subset of the Unicode character set than the Ansi-encoded fonts.
XQuery Processors
The following XQuery processors are not for the XML course.
Qizx/open (version 1.1p7) is called as follows.
- /home/group/xmltools/bin/process-xquery query.xq
Documentation of QizX/open. Try Saxon, too.
Browsers
Late versions of Mozilla (including Firefox) and IE should be able to show XML documents in tree form without any further settings. See the project work example [example-ss.xml (.txt)] to find out how to let the browser know about your XSLT stylesheet. (Ancient versions of IE did this differently; so, you may need to update your browser.)
Additional example files (XML, XSL)
- XSL-FO/XSLT example at https://www.cs.helsinki.fi/i/mraento/xsl-examples/
- Project work example
- Some other examples
- A bunch of XSL-FO examples
- A comprehensive DTD+XML & XSLT->HTML & XSLT->FO example using the recipes vocabulary (files po* here make another example about schemas and namespaces)
Oskari Heinonen (based on earlier versions by Mika Raento and others)