Re: [xslt] needed:set xslt variable in program
- From: "Buchcik, Kasimier" <k buchcik 4commerce de>
- To: "Tom Stanley" <stdanley yahoo com>
- Cc: xslt gnome org
- Subject: Re: [xslt] needed:set xslt variable in program
- Date: Wed, 21 Jun 2006 18:21:12 +0200
Hi,
There's another way to do what you want.
On the XSL mailing list (xsl-list lists mulberrytech com) someone
asked about how to do this with PHP 5.
I'm quoting Martynas Jusevicius:
"
In PHP4's processing function there was an option of passing such
arguments and later accessing them through Sablotron-specific scheme
"document('arg:/...)".
"
This can be done in Libxslt/Libxml2 by customizing Libxml2's
IO layer, or by customizing the document loader of
Libxslt via xsltSetLoaderFunc().
Regards,
Kasimier
> -----Original Message-----
> From: Tom Stanley [mailto:stdanley yahoo com]
> Sent: Thursday, June 15, 2006 4:09 AM
> To: The Gnome XSLT library mailing-list
> Cc: Buchcik, Kasimier
> Subject: Re: [xslt] needed:set xslt variable in program
>
>
> hi,Kasimier
>
> --- "Buchcik, Kasimier" <k buchcik 4commerce de>
> wrote:
>
>
> > The common solution for this would be to use the
> > document() function:
> >
> > <xsl:template match="/">
> > <foo>
> > <xsl:value-of
> > select="document('my-report.xml')/Report/Data[1]"/>
> > </foo>
> > </xsl:template>
> >
> this thoughts is good,the only limit is we don't like
> to load file from disk,but from an existed xmlNodePtr
> from memory
> > If you need a more sophisticated mechanism, then you
> > could implement
> > an extension element/function. Have a look at how
> > e.g. the
> > EXSLT function node-set() is implemented in
> > Libxslt/Libexslt:
> > The XPath engine calls exsltNodeSetFunction() (in
> > "libexslt/common.c"),
> > then xsltFunctionNodeSet() (in "libxslt/extra.c") is
> > called, which
> > changes a result tree fragment into a node set.
> >
> > In such an extension function, you could just
> > hand-over a copy of an
> > internal node tree managed by your application.
> > <foo>
> > <xsl:value-of
> > select="mf:my-func('my-var-name')/Report/Data[1]"/>
> > </foo>
> we would do some test using this method.
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]