Transform an XML file using a stylesheet (XSL).
Usage: java igpp.xml.Transform [options] file
Options:
usage: igpp.xml.Transform
| -h,--help | Display this text |
| -s,--stylesheet | Stylesheet. The XML style sheet. |
| -v,--verbose | Verbose. Show status at each step. |
Acknowledgements:
Development funded by NASA's PDS project at UCLA.
A command like:
where 'family.xml' contains
<?xml version="1.0" encoding="ISO-8859-1"?>
<doc>
<name>John</name>
<sibling>
<name>Paul</name>
<child>
<name>William</name>
</child>
</sibling>
</doc>
and 'family.xsl' contains:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/doc">
<html>
<head>
<style>
.indent { margin-left: 16px; }
</style>
</head>
<body>
<h2><xsl:value-of select="name"/>'s Family</h2>
<xsl:for-each select="sibling">
Sibling: <xsl:value-of select="name"/>
<div class="indent">
<xsl:for-each select="child">
Child: <xsl:value-of select="name"/>
</xsl:for-each>
</div>
</xsl:for-each>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
will generate something like: