Re: [xslt] libxslt-1.0.1 is released



I don't really know how it works but I have
a working example:
################
1. example (without cast)
#################

<!-- save the defaulttree (this is the XML-File you give as argument to 
xsltproc -->
 <xsl:variable name="defaulttree" select="/"/> 
...
<!-- change environment to the external xml File
 <xsl:apply-templates select="document($sitetemplate)" mode="sitetemplate"/> 
...  

 <xsl:template match="*" mode="sitetemplate">
        ...
        <!-- parse the external xmlFile -->
        ...
       <!-- change environment to the default xmlFile -->
       <xsl:for-each select="$defaulttree">
             <xsl:call-template name="cms">
                      <xsl:with-param name="cmsElement" select="$cms"/>
             </xsl:call-template>
       </xsl:for-each>
       <!-- now you "are" again in the external file -->
...

In this case you don't need a cast.
####################################
2. example (with cast)
#############################
<xsl:template name="navigation">
                <xsl:variable name="naviFlat">
                        <xsl:call-template name="collapsenavi"/>  
                </xsl:variable>
                <xsl:apply-templates select="libxslt:node-set($naviFlat)" 
mode="naviItems"/>
 
        </xsl:template>
....

 <xsl:template match="*" mode="naviItems">
                <xsl:for-each select="nodes/node">
                          <!-- do something with the content of the variable 
elements -->
                </xsl:for-each>
        </xsl:template>
--------------------------------
If have seen this <fake/> tag and do not know what to do with
it, but after trying some hours it worked.
I have no idea when to use a cast.
(I also have no idea when to use a cast in msxsl, sablotron,...)
I also have no idea how to "go" to the defaulttree without storing it
in a variable.

Hope that helps a little

Bernhard



On Tuesday 24 July 2001 12:32, you wrote:
> I am still puzzled about exsl:node-set.
>
> Take this input:
>
> <foo>
>  <xptr doc="TUG">a</xptr>
>  <xptr doc="TUG">a</xptr>
> </foo>
>
> and this stylesheet
>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>     xmlns:exsl="http://exslt.org/common"
>     extension-element-prefixes="exsl"
>                 version="1.0">
>   <xsl:template match="/">
>     <xsl:variable name="x">
>       <hello>bye</hello>
>       <a><xsl:copy-of select=".//xptr"/></a>
>    </xsl:variable>
>    <xsl:message>
>    [<xsl:value-of select="count(exsl:node-set($x)/a/*)"/>]</xsl:message>
>   </xsl:template>
> </xsl:stylesheet>
>
> I expect the answer [3], but xsltproc gives me [0]. Surely that isn't
> right? Saxon, on the same input, gives [3].
>
> If I add <xsl:copy-of select="exsl:node-set($x)"/>, I get back
>
>  <fake><a xmlns:exsl="http://exslt.org/common"><hello>bye</hello><xptr
>  doc="TUG">a</xptr><xptr doc="TUG">a</xptr></a></fake>
>
> what is this <fake> element????
>
> Perhaps someone has a working example of exsl:node-set in libxslt I
> could look at?
>
>
> sebastian
>
> Using libxml 20401, libxslt 10001 and libexslt 200
> xsltproc was compiled against libxml 20401, libxslt 10001 and libexslt 200
> libxslt 10001 was compiled against libxml 20401
> libexslt 200 was compiled against libxml 20401
>
>
> _______________________________________________
> xslt mailing list
> xslt@gnome.org
> http://mail.gnome.org/mailman/listinfo/xslt




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