Using the xsltproc processor
Before you try to apply your XSLT script, you may want to validate the XML file against its DTD. To do this, use the
xmllint --valid --noout
is the name of your XML file. Make sure your DTD is in the same directory and named in a
<!DOCTYPE ...> declaration.
For example, if your XML document uses a DTD named
trails.dtd and its root element is
trails, its first line should look like this:
<!DOCTYPE trails SYSTEM "trails.dtd">
To transform a file using XSLT, use
is the XSLT stylesheet,
is the XML input file, and
is the output file to be written.