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]