namespace prefixes in XSLT parameters

Bruce R Miller <[email protected]> Tue, 18 Sep 2012 19:10:47 -0400
Newsgroups gmane.comp.lang.perl.xml
Message-ID <[email protected]>
Hi all;
  When you pass a parameter to an xslt, for me
the common issue was always to quote it enough,
since the value is actually an XPath expression:
   $stylesheet->transform($document,PARAM=>"'some text'");

I thought I'd get fancy and try using the XPath
functionality.  I guess it's clear that the XPath
will be _evaluated_ inside the stylesheet, and
with the document loaded --- otherwise, it wouldn't
be much use, right?

For example:
   $stylesheet->transform($document,PARAM=>"//ltx:section/ltx:title/text()");

What I hadn't anticipated is that it seems to
get _compiled_ before or outside that context.
In particular, it doesn't know the namespace prefixes
that have been established by the stylesheet
(nor by the document!)

And there seems to be no methods to register such
associations.  Googling turns up an ancient
email that establishes that XPathContext and LibXSLT
are entirely disconnected....

Is there a way to use namespace prefixes?

Thanks;
bruce
_______________________________________________
Perl-XML mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs