Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DTD w/ Select Box Possible? >>>>>

Status
Not open for further replies.

lionroar

Programmer
Oct 19, 2001
6
US
Is it possible to place, lets say a list of countries in a dtd, and then call that in a xsl file to be palced in a select box.

i have a list of countries in a select box in the html form, but when the xml is created i only get the one country that they choose. i display the form back to the user to allow changes, and this is done with xsl, but i have no refernce to the list of countries. how and where can i get this list back into the xsl form.

any help would be greatly appreciated.
 
here is some code i am working with.
test.xml
<?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>
<?xml-stylesheet type=&quot;text/xsl&quot; href=&quot;test.xsl&quot;?>
<form1>
<month>05</month>
</form1>



test.xsl
<?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>
<xsl:stylesheet version=&quot;1.0&quot; xmlns:xsl=&quot; xmlns:fo=&quot;<xsl:template match=&quot;month&quot;>
<select id=&quot;months&quot;>
<xsl:for-each select=&quot;option&quot;>
<option value=&quot;00&quot;>00</option>
<option value=&quot;01&quot;>01</option>
<option value=&quot;02&quot;>02</option>
<option value=&quot;03&quot;>03</option>
<option value=&quot;04&quot;>04</option>
<option value=&quot;05&quot;>05</option>
<option value=&quot;06&quot;>06</option>
<option value=&quot;07&quot;>07</option>
<option value=&quot;08&quot;>08</option>
<option value=&quot;09&quot;>09</option>
<option value=&quot;10&quot;>10</option>
<option value=&quot;11&quot;>11</option>
<option value=&quot;12&quot;>12</option>
<xsl:if test=&quot;@month=@value&quot;>
<xsl:attribute name=&quot;selected&quot;>selected</xsl:attribute>
</xsl:if>
<xsl:value-of select=&quot;@month&quot;/>
</xsl:for-each>
</select>
</xsl:template>


<xsl:template match=&quot;/&quot;>
<html>
<title></title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot; />
<xsl:apply-templates select=&quot;/descendant::month&quot; /> <br></br>

</html>
</xsl:template>

</xsl:stylesheet>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top