I am attempting to compose a style sheet that, given an XML input (obviously) and a parameter that specifies a "target", will produce a list of commands that match that target. Here is the style sheet as written:
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:param name="target" select="cora_cmd"/>
<xsl:output method="xml" indent="yes"/>
<xsl:template match="command/program">
<xsl:if test="@name=$target">
<xsl:message terminate="no">found match <xsl:value-of select="$target"/> </xsl:message>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude">
<xsl:attribute name="href"><xsl:value-of select="../@help"/></xsl:attribute>
</xi:include>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
I am invoking xsltproc to execute this style sheet as follows:
xsltproc --param target cora_cmd gen-commands.xsl commands.xml
The problem that I am encountering is that the parameter value for target does not seem to get set. At least the name that comes from the message appears to be an empty string and the test for xsl:if always fails. I am certain that this is due to some bone-headed mistake on my part but I've yet to recognise it. Does anybody know what I've done wrong?