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

xsl inside form element not working

Subject: xsl inside form element not working
From: himanshu padmanabhi <himanshu.padmanabhi@xxxxxxxxx>
Date: Thu, 5 Mar 2009 18:25:59 +0530
 xsl inside form element not working
<CODE>
#print "<form action=main.cgi method=post name=formname>";
#If I uncomment above line,form.submit in xsl file doesn't work
my $parser = XML::LibXML->new();
my $xslt = XML::LibXSLT->new();

my $source = $parser->parse_file("abc.xml");
my $style_doc = $parser->parse_file("abc.xsl");

my $stylesheet = $xslt->parse_stylesheet($style_doc);

my $results = $stylesheet->transform($source, args => "' '",val => "'2'");
print $stylesheet->output_string($results);
#print "</form>"
</CODE>

Above code otherwise works(form.submit in xsl works).But If I
uncomment form lines above,then form.submit doesnt work.what can be
the problem?

<CODE>
abc.xsl

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

<xslutput method="html"/>

<xsl:template match="tracks">
<form name="form1" method="POST" action="abc.cgi">
<table border="1">
<tr>
<td> Parameter </td>
<td> Description </td>
<td> Value </td>
</tr>
<xsl:apply-templates/>
</table>
</form>
<script>
document.form1.submit();
</script>
</xsl:template>

<xsl:template match="abc">
<tr>
<td>
<xsl:value-of select="label"/>
</td>
<td>
<xsl:value-of select="desc"/>
</td>
<td>
<xsl:if test="label = 'machine name'">
<input type="text" name="args1" value="">
</input>
</xsl:if>
</td>
</tr>
</xsl:template>

</CODE>

<CODE>
abc.xml

<?xml version='1.0'?>
<?xml-stylesheet href="abc.xsl" type="text/xsl"?>

<tracks>
<abc>
<label>machine name</label>
<desc>specify machine name</desc>
</abc>
</tracks>

</CODE>

------------------------------
Regards,
Himanshu Padmanabhi

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.