[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
Hi Kristof:
At 04:23 PM 4/4/01, you wrote:
Why "of course"?
Ahh -- given your example, it seems you want some logic like:
Then you could just do
<xsl:for-each select="document('../../released_xml/news_xml_en/newsticker.xml')/News/Block[@STARTDATE = '01']" >...</xsl:for-each>
<xsl:if test="not(document('../../released_xml/news_xml_en/newsticker.xml')/News/Block[@STARTDATE = '01'])">...</xsl:if>
or, more efficiently and clearer:
<xsl:variable name="blocks" select="document('../../released_xml/news_xml_en/newsticker.xml')/News/Block[@STARTDATE = '01']"/>
<xsl:for-each select="$blocks" >...</xsl:for-each>
<xsl:if test="not($blocks)">...</xsl:if>
But of course I'm still guessing a bit as to what you're trying to do...:-)
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
RE: [xsl] count selected nodes in for-each
Subject: RE: [xsl] count selected nodes in for-each From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Wed, 04 Apr 2001 11:58:30 +0100 |
Hi Kristof:
At 04:23 PM 4/4/01, you wrote:
xsl:choose is outside the xsl:for-each of course
Why "of course"?
Ahh -- given your example, it seems you want some logic like:
<xsl:for-each select="(...)"> ... </xsl:for-each> <xsl:if test="(no nodes were handled by for-each)"> </xsl:if>
Then you could just do
<xsl:for-each select="document('../../released_xml/news_xml_en/newsticker.xml')/News/Block[@STARTDATE = '01']" >...</xsl:for-each>
<xsl:if test="not(document('../../released_xml/news_xml_en/newsticker.xml')/News/Block[@STARTDATE = '01'])">...</xsl:if>
or, more efficiently and clearer:
<xsl:variable name="blocks" select="document('../../released_xml/news_xml_en/newsticker.xml')/News/Block[@STARTDATE = '01']"/>
<xsl:for-each select="$blocks" >...</xsl:for-each>
<xsl:if test="not($blocks)">...</xsl:if>
But of course I'm still guessing a bit as to what you're trying to do...:-)
Cheers, Wendell
-----Original Message----- From: David Carlisle [mailto:davidc@xxxxxxxxx] Sent: woensdag 4 april 2001 17:11 To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: Re: [xsl] count selected nodes in for-each
> ...
you haven't said whether the xsl:choose is inside or outside the for-each.
If it's inside then you can use last() otherwise you can use count(document('../../released_xml/news_xml_en/newsticker.xml')/News/Block [@STARTDATE = '01']" )
David
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] count selected nodes in f, Kristof Bernaert | Thread | Re: [xsl] count selected nodes in f, David Carlisle |
Re: [xsl] XSLT hosting, David Carlisle | Date | RE: [xsl] XSLT editor, Chris Bayes |
Month |
Keywords