[xslt] Passing XPath expressions to XSLT as parameters



Hi All,

I am presently converting an application from Windows to Linux.  Currently
it has the Windows scripting engine doing multiple XSLT operations with
JScript and getting the data through Web Service calls.  I am using Perl
5.8.3 with libxml2 and LibXML-1.58, LibXSLT-1.57 from CPAN.

My previous experience with passing parameters to XSLT involved simply
strings, and this works fine.  This application passes XPATH subtrees, which
the XSLT step extracts values from.  The XSL file is over 4500 lines long,
so that I am not to keen on rewriting it.  I can pass this subtree as a
string (< 1000 characters), but all the <,>," get escaped into &lt; , etc.
I thought that I might be able to convert the string as exslt:node-list and
extract values this way, but no go.  (That does work fine if I simple paste
the entire parameter string into the XSL file as a global <xsl:variable>.)

I have tried passing it as a LibXPATH object, but no go there either.  Is
there any way that I can stop this escaping of the XPATH expression?  I am
not sure if this is being done by the Perl part or the gnome LibXSLT part.
Or perhaps someone can suggest a different approach?

Thanks in advance for any assistance that might be offered.

Bob Stobie
bstobie axsone com



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]