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:
> 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?


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

  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 Veillard      | Red Hat Network  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

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