[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Cannot process a result tree fragment as a node-se

Subject: Re: Cannot process a result tree fragment as a node-set under XSLT 1.0 - My alternative don´t function
From: "Alejandro" <alexcontini@xxxxxxxx>
Date: Sat, 12 Apr 2008 14:27:33 +0100
Re:  Cannot process a result tree fragment as a node-se
Hi Martin,

ItB4s correct.

I want to count the RecursoEx1 elements
<p>Number: <xsl:value-of select="count(exsl:node-set($filter)/RecursoEx1)"/></p>
although with your sample document and stylesheet variables that count is 0. OK!!


I want to iterate over the RecursoEx1 elements
<xsl:for-each select="exsl:node-set($filter)/RecursoEx1">      OK!!

Martin:

But it is not clear what you want to achieve and why you use xsl:copy-of
and exsl:node-set, it looks to me as if that might not be necessary at all.

I use xsl:copy-of and exsl:node-set because to error "Cannot process a result tree fragment as a node-set under XSLT 1.0" if i code :

<xsl:variable name="filtro">
<xsl:choose>
<xsl:when test="$option=1">
<xsl:copy-of select="//RecursoEx1[F_FIN=$date1]"/></xsl:when>
<xsl:otherwise>
<xsl:copy-of select="//RecursoEx1[F_FIN=$date2]"/></xsl:otherwise>
</xsl:choose>
</xsl:variable>


<p>Number: <xsl:value-of select="$filter"/></p>

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


and i donB4t know if exits another posibility. Exists??


The variable "option" is to received from one formulary, but there are more and then the "filter" will be dynamic.

How can i do to construct the filter dynamic? For example, i receive one varible named "title" from the formulary with the value: "John Martin Car Monday" and i like to enumerate the RecursoEx1 elements that meet with this condition: TITLE=John or TITLE=Martin or TITLE=Car or TITLE=Monday.

or title variable is Apple Pencil, ..... then the condition will be TITLE=Apple or TITLE=Pencil

i donB4t know how may parameters i will receive in advance



Fine Thanks,
Alexander

PD: My english is very bad :)

----- Mensaje original ----- De: "Martin Honnen" <Martin.Honnen@xxxxxx>
Para: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Enviado: sC!bado, 12 de abril de 2008 13:32
Asunto: Re: Cannot process a result tree fragment as a node-set under XSLT 1.0 - My alternative donB4t function



Alejandro wrote:

<p>Number: <xsl:value-of select="count(exsl:node-set($filter))"/></p> <!-- DON'T FUNCTION -->

count should give 1. I guess you want to count the RecursoEx1 elements so you should use
count(exsl:node-set($filter)/RecursoEx1)
although with your sample document and stylesheet variables that count is 0.


<xsl:for-each select="exsl:node-set($filter)">

I guess you want to iterate over the RecursoEx1 elements so you would need <xsl:for-each select="exsl:node-set($filter)/RecursoEx1">


But it is not clear what you want to achieve and why you use xsl:copy-of and exsl:node-set, it looks to me as if that might not be necessary at all.



--


Martin Honnen
http://JavaScript.FAQTs.com/

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.