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

Re: for-each question

Subject: Re: for-each question
From: Ronald <ronald@xxxxxxxxxxx>
Date: Thu, 26 Apr 2001 13:45:27 +0100
Re:  for-each question
You're not specifying you want both documents to be generated.
This is probably called the "xsl:for-each trap".

Maybe you can try to do without the xsl for-each?
xsl:value-of only gives you the first value!

Try xsl:apply-templates here, or another xsl:for-each commando.

If you really have to use xsl:for-each, why are you not specifying the xsl for-each as:
<xsl:for-each select="/eventsCalendar/eventRecord[eventID=$neweventID]/listDoc/document">
for it is the content of your for-each that has to be outputted for each document, and not for each listdoc.


I would suggest that you rewrite this fragment and try not to use xsl:for-each but xsl:apply-templates etc.

Ronald

At 12:34 PM 4/26/01 +0100, you wrote:
I have the following xml:
<eventsCalendar>
   <eventRecord>
                <eventID>1</eventID>>
                ----
                <listDoc>
                  <document href="C:\events1.doc">agenda.doc</document>
                  <document href="C:\events2.doc">conference.doc</document>
                </listDoc>
     </eventRecord>
----
</eventsCalendar>

and the following xsl:
The parameter was set earlier
-------
 <td colspan="3" width="363">
            <xsl:for-each
select="/eventsCalendar/eventRecord[eventID=$neweventID]/listDoc/">
            <font face="Arial, Helvetica, sans-serif" color="#000000"
size="1">
                        <a>
                                <xsl:attribute name="href"><xsl:value-of
select="document/@href"/></xsl:attribute>
                                <xsl:value-of select="document"/>
                        </a>
                    </font>
             </xsl:for-each>
             </td>

-----------
Output:
Just a link to agenda.doc is returned and not both documents. Any
suggestions?

Tanz



XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list


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.