[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
Hi Michael,
Thank you so much for the quick response. Michael >>However, it's not clear to me that you need to create an RTF in the first place. Why not define $filter as <xsl:variable name="filter" select="//RecursoEx1[($option=1 and F_FIN=$date1 and contains(TITULO,'o')) or ($option=2 and F_FIN=$date2)]"/> I want to count the RecursoEx1 elements: <p>Number: <xsl:value-of select="count(exsl:node-set($filter)/RecursoEx1)"/></p> CORRECT! I want to iterate over the RecursoEx1 elements: <xsl:for-each select="exsl:node-set($filter)/RecursoEx1"> CORRECT ! 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 don4t 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 don4t know how may parameters i will receive in advance.. Thanks again Michael, Alexander ----- Mensaje original ----- De: "Michael Kay" <mike@xxxxxxxxxxxx> Para: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx> Enviado: sabado, 12 de abril de 2008 14:03 Asunto: RE: Cannot process a result tree fragment as a node-set under XSLT 1.0 - My alternative don4t function
However, it's not clear to me that you need to create an RTF in the first place. Why not define $filter as <xsl:variable name="filter" select="//RecursoEx1[($option=1 and F_FIN=$date1 and contains(TITULO,'o')) or ($option=2 and F_FIN=$date2)]"/> Note also, that horrible bit of disable-output-escaping can be avoided by setting the doctype-system and doctype-public attributes on xsl:output. Michael Kay http://www.saxonica.com/ -----Original Message----- From: Alejandro [mailto:alexcontini@xxxxxxxx] Sent: 12 April 2008 13:05 To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: Cannot process a result tree fragment as a node-set under XSLT 1.0 - My alternative don4t function
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|