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

loop problem (NEWBIE)

Subject: loop problem (NEWBIE)
From: thomas <thomas.lohbeck@xxxxxx>
Date: Mon, 09 Sep 2002 19:20:39 +0200
xsl for next loop
first a little german-xml for beginners. ;-)
<frage>=<question>, <antwort>=<answer>
got it? ok!

Im having a problem with the following task.

I want a simple fo:table. Left cell, the question, right cell the answer.
I managed to loop over the <frage> and put the content in a new row/cell. But how do I get the accordant <antwort> in the SAME loop in the second cell?

I tried to make 2 loops each and put it in tables next to each other. The problem is when the content from the right <antwort> table is bigger than the left <frage> table , the <frage> and <antwort> are not on the same row.

forgive me my ugly source o great xsl programmers. Im a newbie....

 <frage>frage 1 frage 1?</frage>
 <antwort>antwort 1 antwort 1 antwort 1 antwort 1</antwort>
 <frage>frage 2 frage 2?</frage>
 <antwort>antwort 2 antwort 2 antwort 2 antwort 2</antwort>
 <frage>frage 3 frage 3?</frage>
 <antwort>antwort 3 antwort 3 antwort 3 antwort 3</antwort>
 <frage>frage 4 frage 4?</frage>
 <antwort>antwort 4 antwort 4 antwort 4 antwort 4</antwort>

xsl: ..... <fo:table padding-left="1.5cm"> <fo:table-column column-width="5cm"/> <fo:table-column column-width="10cm"/> <fo:table-body> <fo:table-row> <fo:table-cell> <fo:block> <fo:table> <fo:table-column column-width="5cm"/> <fo:table-body> <xsl:for-each select="/page/info/profil/frage"> <fo:table-row> <fo:table-cell> <fo:block> <xsl:value-of select="."/> </fo:block> </fo:table-cell> </fo:table-row> </xsl:for-each> </fo:table-body> </fo:table> </fo:block> </fo:table-cell> <fo:table-cell> <fo:block> <fo:table> <fo:table-column column-width="5cm"/> <fo:table-body> <xsl:for-each select="/page/info/profil/antwort"> <fo:table-row> <fo:table-cell> <fo:block> <xsl:value-of select="."/> </fo:block> </fo:table-cell> </fo:table-row> </xsl:for-each> </fo:table-body> </fo:table> </fo:block> </fo:table-cell> </fo:table-row> </fo:table-body> </fo:table> .....

I know its can be simple, but Im not a programmer and could not get the logic....

this is a nice and easy question, isn't it? a nice and welcome change to the other hard question.


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

Current Thread


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.
First Name
Last Name
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.