abc.cgi 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);
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>
abc.xsl <xsl:template match="tracks"> <form name="form1" method="POST" action="logic.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> </xsl:stylesheet>
abc.cgi works as stated here. But if I take it under my form
print "<form action=someform.cgi method=post name=somename>"; abc.cgi code print "</form>";
then it I get my form elements printed from XSL file,but form1.submit from it doesn't work. Please help.Since this is combination of XML,XSL,CGI,I am unware which forum should i try.

In reply to code under "form" not working by himanshu.padmanabhi

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.