[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: getting combo value,not textbox value

Subject: Re: getting combo value,not textbox value
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 27 Feb 2009 11:56:13 GMT
Re:  getting combo value
As has been explained, your problem is not to do with xslt, it is simply
an error in your generated html.

Your posted xsl (it would be better to post complete but small
stylesheet rather than a fragment) if made into a working stylesheet, looks
like this:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 xmlns:str="http://exslt.org/strings"
>

<xsl:import href="http://www.exslt.org/str/functions/tokenize/str.tokenize.template.xsl" />

<xsl:output indent="yes"/>
<xsl:variable name="idx" select="'???'"/>
<xsl:variable name="sidx" select="'???'"/>
<xsl:variable name="input" select="'???'"/>
<xsl:variable name="new" select="'???'"/>

 <xsl:template match="records">
    <table border="1">
        <tr>
            <td> Parameter </td>
            <td> Description </td>
            <td> Value </td>
        </tr>
        <xsl:apply-templates/>
    </table>
</xsl:template>

<xsl:template match="one">
    <form name="form1" method="POST" action="one.cgi">
    <tr>
        <td>
            <xsl:value-of select="label"/>
        </td>
        <td>
            <xsl:value-of select="desc"/>
        </td>
        <td>
            <xsl:if test="label = 'machine name'">
                    <select name="machine_name">
                      <xsl:call-template name="str:tokenize">
                      </xsl:call-template>
                     </select>
             </xsl:if>
             <xsl:if test="label = 'limit'">
                  <input type="text" name="limit" value="">
                  </input>
             </xsl:if>
        </td>
         <input type="hidden" name="idx" value="{$idx}"/>
         <input type="hidden" name="sidx" value="{$sidx}"/>
         <input type="hidden" name="new" value="{$new}" />
    </tr>
    </form>
    <script>
        document.form1.submit();
    </script>
</xsl:template>

</xsl:stylesheet>

If run on your example input it produces the html below which has two
forms with the same name. So first you need to correct the html to
either have one form, or two forms with different names. Once you have
working html then you should be able to write the xslt to generate the
required html.

Don't try to debug your stylesheet by executing the generated code
directly in a browser. Do it in two separate steps, so you can -see_ the
output from xslt.

The output from the above is:

$ saxon abc.xml abc.xsl
<?xml version="1.0" encoding="utf-8"?>
<table xmlns:str="http://exslt.org/strings" border="1">
   <tr>
      <td> Parameter </td>
      <td> Description </td>
      <td> Value </td>
   </tr>
    
   <form name="form1" method="POST" action="one.cgi">
      <tr>
         <td>machine name</td>
         <td>specify machine name</td>
         <td>
            <select name="machine_name"/>
         </td>
         <input type="hidden" name="idx" value="???"/>
         <input type="hidden" name="sidx" value="???"/>
         <input type="hidden" name="new" value="???"/>
      </tr>
   </form>
   <script>
        document.form1.submit();
    </script>
    
   <form name="form1" method="POST" action="one.cgi">
      <tr>
         <td>limit</td>
         <td>specify limit which should not exceed</td>
         <td>
            <input type="text" name="limit" value=""/>
         </td>
         <input type="hidden" name="idx" value="???"/>
         <input type="hidden" name="sidx" value="???"/>
         <input type="hidden" name="new" value="???"/>
      </tr>
   </form>
   <script>
        document.form1.submit();
    </script>

</table>



________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. 
________________________________________________________________________

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.