This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
No Subject
- To: <XSL-List at mulberrytech dot com>
- From: "Rajeev Dubey" <rajeev at triplehop dot com>
- Date: Wed, 4 Oct 2000 15:54:55 -0400
- Reply-To: xsl-list at mulberrytech dot com
hi, i want to put check-boxes or combo-boxes in my XSL page based on the
type of choice.
means check-boxes if choice type is CHECK-SMALL or combo-boxes if it's
SELECT-SMALL.
but i can't figure out a way how to do it ?
====================XML file=============
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="test3.xsl"?>
<searchpage>
<module seq="1" type="MODULE-SMALL">
<mname>Activities</mname>
<question id="1" seq="1">
<qname>What do you enjoy? Check all that apply.</qname>
<choice id="6" type="CHECK-SMALL" name="ACTIVITIES">
<cvalue>Relaxing</cvalue>
</choice>
<choice id="7" type="CHECK-SMALL" name="ACTIVITIES">
<cvalue>Sights & Culture</cvalue>
</choice>
</question>
</module>
<module seq="18" type="MODULE-SMALL">
<mname>Timing</mname>
<question id="2" seq="1">
<qname>When are you leaving?<BR></BR><BR></BR>Please select a
month</qname>
<choice id="59" type="SELECT-SMALL" name="WHEN">
<cvalue>Mid January</cvalue>
</choice>
<choice id="61" type="SELECT-SMALL" name="WHEN">
<cvalue>Early February</cvalue>
</choice>
</question>
<question id="3" seq="2">
<qname>Or select a specific holiday?</qname>
<choice id="95" type="SELECT-SMALL" name="HOLIDAY">
<cvalue>President's Day</cvalue>
</choice>
<choice id="97" type="SELECT-SMALL" name="HOLIDAY">
<cvalue>Easter Day</cvalue>
</choice>
</question>
</module>
<module seq="4" type="MODULE-SMALL">
<mname>Departure City</mname>
<question id="4" seq="1">
<qname>Please choose your gateway?</qname>
<choice id="32" type="SELECT-SMALL" name="DEPARTURECITY">
<cvalue>Minneapolis</cvalue>
</choice>
<choice id="33" type="SELECT-SMALL" name="DEPARTURECITY">
<cvalue>Orlando</cvalue>
</choice>
</question>
</module>
<module seq="5" type="MODULE-LARGE">
<mname>Optional Criteria</mname>
<question id="5" seq="1">
<qname>If you wish, you can refine your search further.<BR></BR>Would
you like to:</qname>
<choice id="19" type="CHECK-LARGE" name="OPTIONALCRITERIA">
<cvalue>Specify a Region</cvalue>
</choice>
<choice id="20" type="CHECK-LARGE" name="OPTIONALCRITERIA">
<cvalue>Set a Budget</cvalue>
</choice>
</question>
</module>
</searchpage>
==========================================XSL file==============
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="/">
<html>
<head>
<title>Search Page <xsl:value-of
select="searchpage/module/mname"/></title>
</head>
<body BGCOLOR="#999999">
<table border="0" width="70%" BGCOLOR="#dddddd">
<xsl:for-each select="searchpage/module">
<tr>
<td align="center"><hr></hr>
<font face="Verdana" color="#562988" size="3"><b>
<xsl:value-of select="mname"/>
</b></font>
<hr></hr></td>
</tr>
<xsl:for-each select1="searchpage/module/question">
<tr>
<td align="left" width="80%"><i><xsl:value-of
select="qname"/></i></td>
</tr>
<xsl:for-each select2="searchpage/module/question/choice">
<tr>
<td align="left">
<font face="Verdana" color="#222222" size="2">
<xsl:value-of select="cvalue"/>
</font>
</td>
<td>
<xsl:value-of select="@id"/>
</td>
</tr>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list