Do the separating in Perl (for example with the split statement) and pass the individual arguments/parameters to the XSLT. So something like:
In the xslt:
<xsl:param name="param_1"/>
<xsl:param name="param_2"/>
In the Perl script:
my ($par1, $par2) = split (/ /,$str);
my $results = $stylesheet->transform($source,
XML::LibXSLT::xpath_to_string(param_1 => $par1),
XML::LibXSLT::xpath_to_string(param_2 => $par2)
);
NB The utility function xpath_to_string takes care of the quoting. This is probably the better/easier way of doing things. See the documentation for details.
See playing with XSLT for a bigger example.
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.