Here is a collection of pointers to relevant standards and tutorials on the Web:
You can use your favorite editor to edit XML documents. The file name should have suffix .xml. Emacs has a descent SGML mode for editing XML, which is automatically invoked for file names with .xml suffix. There are also many specialized XML editors available, and some of them come with nice templates and automatic validation. Just search for "XML editor" in Google.
Some XML and DTD examples can be found on rack40 in /home/dbcourse/examples/xml-zthes/.
To check that your XML document is well-formed (i.e., no synatx errors), use the command java -classpath /home/dbcourse/examples/jaxp SaxEcho file on rack40, where file is the file name of the XML document. The command will echo the parsed XML to stdout.
To validate your XML document against a DTD (you will need a <!DOCTYPE declaration in the XML document), use the command java -classpath /home/dbcourse/examples/jaxp SaxEcho -v file. The additional -v flag turns on validation.
If you edit XML on a Windows machine, you can fire up Internet Explorer and use it to open your XML document. IE will automatically validate the XML document and display it in a nice format.
QuiP is an XQuery engine by Software AG. You can run QuiP either in batch mode or with its GUI. The GUI is recommended for testing your queries since it provides synatx highlighting for XQuery and displays query results in a nice tree format. To run the GUI on rack40, type QuipGui.sh &. The interface is pretty self-explanatory. To start, type in the following query and click on "EXECUTE":
<result> { document("/usr/research/proj/dbgroup/software/QuiP/examples/theater/othello.xml")//PERSONA } </result>
To run QuiP in batch mode, type quip xquery_file, where xquery_file is the name of a text file containing your XQuery. The result will be output to stdout.
The current version of QuiP has a lot of quirks; please consult the "QuiPified" XQuery examples used in the XQuery lecture (under the Lecture Notes section of the course Web site) for reference.
On rack40, use the command java -classpath /home/dbcourse/examples/jaxp Stylizer xsltFile xmlFile to transform input xmlFile using the XSLT stylesheet xsltFile. The result document will be output to stdout.
You can read the code in /home/dbcourse/examples/jaxp/Stylizer.java for an example of automatically applying XSLT transformations inside Java code.
Plenty of examples can be found in /home/dbcourse/examples/jaxp/ on rack40. SaxEcho.java uses an SAX parser to parse and validate an input XML document, and uses SAX API to echo the input to stdout. DomEcho.java uses a DOM parser to parse and validate an input XML document and to build an in-memory DOM representation of the input; it then uses DOM API to print the DOM tree out as XML. DomTree.java prints out the DOM tree representation directly, which can be useful in debugging. The standard way of converting DOM into XML for output is to use a default Transformer, which is illustrated in Stylizer.java. Stylizer.java also shows how to use Transformer to perform XSLT transformations.
On rack40, your CLASSPATH is already set up to include the standard JDK library (and hence the JAXP library). Therefore, you can simply use javac *.java to compile your code. However, since the standard CLASSPATH does not include the current directory, you may need to use java -classpath . JavaClassName in the directory containing JavaClassName.class.