xsl-list
[Top] [All Lists]

Re: [xsl] Cannot process a result tree fragment as a node-set under XSLT 1.0 - My alternative don´t function

2008-04-17 03:45:18
OK, but i need also to obtain the value of total variable. Any 
suggestion?

<xsl:param name="titulo"></xsl:param>

<xsl:variable name="filter" select="exp[condition]"/>

<xsl:variable name="total" select="count($filter)"></xsl:variable> 

xsl:choose>
<xsl:when test="$total=0">
     <p>No events</p>
</xsl:when>
<xsl:otherwise>         
     <xsl:for-each select="$filter">
        <p><xsl:value-of select="TITULO"/></p>
            ......
    </xsl:for-each>     


   <xsl:if test="$total > 10">
     <xsl:call-template name="pagination">
              <xsl:with-param name="curpage" select="$page"/>
              <xsl:with-param name="lastpage" select="ceiling($total 
div 10)"/>
              <xsl:with-param name="pages" select="4"/> 
             <xsl:with-param name="url" select="$url"></xsl:with-
param>                                                                  
     </xsl:call-template>       
</xsl:if>               

</xsl:otherwise>
                
</xsl:choose>   

Thank you very much,
Alexander


----Mensaje original----
De: davidc(_at_)nag(_dot_)co(_dot_)uk
Recibido: 17/04/2008 11:33
Para: <xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com>
Asunto: Re: Re: [xsl] Cannot process a result tree fragment as a node-
set under XSLT 1.0 - My alternative don´t function

PD: str:to-upper is a template that converts all lowercase letters 
to 
uppercase and I use xml v1.0 version  

Can't you just use the translate function, then as it is all Xpath it 
is
trivial to put it into an Xpath filter.

If you can't (perhaps because you need an s sharp ligature to 
uppercase
to SS) then you can't do it in a single xpath filter in XSLT 1 you 
will
need something like
<xsl:for-each select="exp">
 <xsl:variable name="x">
  <xsl:call-template...
  </xsl:variable<

 <xsl:if test="contains(...)

    ... do something
 </xsl:if>
</xsl:for-each>

David


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

--------------------------

Hi, 

<xsl:variable name="filter" select="exp[condition]"/>

I need that condition is:

      contains(<xsl:call-template name="str:to-upper"><xsl:with-param 
name="text" select="TITULO"></xsl:with-param></xsl:call-template>, 
<xsl:
call-template name="str:to-upper"><xsl:with-param name="text" 
select="$titulo"></xsl:with-param></xsl:call-template>)

and no:  

    contains(TITULO,$titulo)

Some suggestion?

Thank you very much,
Alexander


PD: str:to-upper is a template that converts all lowercase letters to 
uppercase and i use xml v1.0 version 

<xsl:param name="titulo"></xsl:param>

<xsl:variable name="filter" select="exp[condition]"/>

<xsl:variable name="total" select="count($filter)"></xsl:variable> 

<xsl:for-each select="$filter">
          <p><xsl:value-of select="TITULO"/></p>
            ......
</xsl:for-each>

....

<xsl:if test="$total > 10">
    <xsl:call-template name="pagination">
        <xsl:with-param name="curpage" select="$page"/>
        <xsl:with-param name="lastpage" select="ceiling($total div 
$por_pagina)"/>
        <xsl:with-param name="pages" select="4"/> 
        <xsl:with-param name="url" select="$url"></xsl:with-param> 
    </xsl:call-template> 
</xsl:if> 





Ahora también puedes acceder a tu correo Terra desde el móvil.
Infórmate pinchando aquí.



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--