Dylan Parker
The following will generate a checkbox, selected or not dependent on source document content <?xml version="1.0" standalone="yes"?>
<DemoMenu>
<option strValue="A Check Box" textValue="N"/>
</DemoMenu>
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
<!-- ************************************************************ -->
<xsl:template match="/"><html><head></head><body>
<xsl:apply-templates/></body></html>
</xsl:template>
<!-- ************************************************************ -->
<xsl:template match="DemoMenu">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="option">
<p align="center">
<xsl:value-of select="@strValue"/>
<xsl:if test="@textValue='Y'"> <!-- checked -->
<input name="box1" type="checkbox" align="center" checked="Y" value="Y"/>
</xsl:if>
<xsl:if test="not(@textValue='Y')"> <!-- not checked -->
<input name="box1" type="checkbox" align="center" value="Y"/>
</xsl:if>
</p>
</xsl:template>
<xsl:template match="*"/>
</xsl:stylesheet>
|