Can I design a form which consists of textboxes, submit button, reset button, dropdown list using XML?

M.Kumar Sankar

Certainly you can. But for that you need to use XSL technology. Include an XSL stylesheet at the begining of your XML with a processing instruction. In the XSL file you can provide form and text boxes and so on. The XSL file may look as follows.

<?xml version="1.0" ?>
<xml:stylesheet mlns:xsl="http://www.w3.org/TR/WD-xsl>
<xsl:template match="/" >
        <xsl:apply-templates select="/records/name" />  
<xsl:template>
<xsl:template match="name[end()]" >
    <html>
    <body>
    <form action="http://xxxx/servlet/yy">
      <input type=text name="tt">
      <xsl:attribute name="value"><xsl:value-of />
             <xsl:attribute>
    </form>
    </body>
    </html>
<xsl:template>
<xsl:stylesheet>
The main thing to observe here is the attribute values you want to provide dynamically should be generated by using
<xsl:attribute name="xxx"> xxx value <xsl:attribute>
template. The given sample will create a form with one text field, and assigns the value of the last name element in your XML file.
0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact