Re: [xslt] Structured parameters how to



On Sun, Mar 24, 2002 at 12:19:00PM +0100, Eric van der Vlist wrote:
> Hi,
> 
> I need to pass a set of structured parameters to libxslt and my 
> understanding is that you can only pass an array of char values:
> 
> http://xmlsoft.org/XSLT/html/libxslt-transform.html#XSLTAPPLYSTYLESHEET
> 
> xmlDocPtr xsltApplyStylesheet  (xsltStylesheetPtr style,
>                                      xmlDocPtr doc,
>                                      const char **params);
> 
> Apply the stylesheet to the document NOTE: This may lead to a 
> non-wellformed output XML wise !
> 
> style : a parsed XSLT stylesheet
> doc : a parsed XML document
> params : a NULL terminated arry of parameters names/values tuples
> Returns : the result document or NULL in case of error
> 
> Is there any way to pass a RTF or node set like I use to do with XT?

  Hum,

the values are evaluated as XPath expressions in the context of the root
of the target document, exactly like the global variables or parameter
values. So the values can be nodesets, but the current API doesn't allow
to directly pass a subtree. If you use "document()" in the expression it
should be possible to load a node-set dynamically when the parameter is
evaluated.

  I hope this will be sufficient, otherwise it might be possible to
add that functionality, but it would require an API extension I'm afraid.

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard@redhat.com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



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