Actually I want that it should check '$in' hash.It contains '$in{args<number>}'.number is changing thing from 1 onwards.It should pass these '$in{args<number>}' variables to XSL file.#Defining objects for XML,XSLT. my $parser = XML::LibXML->new(); my $xslt = XML::LibXSLT->new(); #Parsing both files my $source = $parser->parse_file($xmlfile); # '$style_doc' represents 'XML::LibXML::Document' object representing +an XSLT file. my $style_doc = $parser->parse_file($xslfile); my $stylesheet = $xslt->parse_stylesheet($style_doc); # 'Transform' returns a scalar that is the XSLT rendering of the 'XML: +:LibXML::Document' object using the desired output format(specified i +n the xsl:output tag in the stylesheet) my $results = $stylesheet->transform($source, XML::LibXSLT::xpath_to +_string(args1=> "$in{'args1'}",args2=> "$in{'args2'}",args3=> "$in{'a +rgs3'}",idx => "$in{'idx'}",newperiod => "$in{'newperiod'}")); # IN ABOVE CASE,I DN'T WANT TO HARDCODE 'ARGS' LIKE 3 ABOVE.I AM GETTI +NG TOTAL NUMBER OF PARAMETERS IN VARIABLE.SO IF ARGS CAN BE 5 IN SOME + CASE,ABOVE LINE SHOULD BE LIKE THIS.. # my $results = $stylesheet->transform($source, XML::LibXSLT::xpath_to +_string(args1=> "$in{'args1'}",args2=> "$in{'args2'}",args3=> "$in{'a +rgs3'}",args4=> "$in{'args4'}",args5=> "$in{'args5'}",idx => "$in{'id +x'}",newperiod => "$in{'newperiod'}")); print $stylesheet->output_string($results);
In reply to passing variable arguments to XSL from perl by himanshu.padmanabhi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |