Re: "Re: [xslt] Apply stylesheet to a subbranch of a document"



On Tue, Sep 16, 2003 at 03:57:33PM +0200, Kasimier Buchcik wrote:
> I took a quick look inside xsltApplyStylesheetInternal()...
> The given doc is set as the initial context node of the transformation:
> 
> ctxt->node = (xmlNodePtr) doc;
> 
> Would the transformation still work correctly if we specify a node other 
> than the document as the initial context node?

  Well correctly can't be asserted because XSLT-1.0 is not defined
for a subdocument.

> Could there be a public function like:
> 
> xsltApplyStylesheet(xsltStylesheetPtr style, 
> 
>    xmlDocPtr doc,
>    xmlNodePtr ctxNode,
>    const char **params);
> 
> with ctxNode specifying the initial context node?

  That could be done, but I'm afraid it's misleading, for the reason
I state: the document is modified, so the subtree would be modified.
I'm not sure it's a good idea to then go on processing with a half 
modified tree.
  I think most entry point called by xsltApplyStylesheetInternal
are public, write the modified function and try it this might work.

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]