[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] reading content with for-each and generating a table (NEWBIE)


Subject: [xsl] reading content with for-each and generating a table (NEWBIE)
From: thomas <thomas.lohbeck@xxxxxx>
Date: Wed, 28 Aug 2002 10:31:45 +0200

Hello...me again...

I like to read the content from the <kunde> tag with the <xsl:for-each> and generate a table containing a number of rows equal to the number of subelements from <kunde> with the content within.

 +----------------+
 |Gaggo           |
 +----------------+
 |Schorsch        |
 +----------------+
 |Röslistrasse 40 |
 +----------------+
 |Postfach        |
 +----------------+
 |8000            |
 +----------------+
 |Zureich         |
 +----------------+
 |Schweiz         |
 +----------------+

I managed to create the table but cant read the content from the subelements. only the content from <kunde>
I think the <xsl:value-of> is my problem.


The solution is close, but Im to stupid.
Thanx a lot
thomas l from z

--xml-snippet------------------------------

 <page>
     <info>
         <offerte>
             <datum>17.08.2002</datum>
         </offerte>
         <kunde>
             <name>Gaggo</name>
             <vorname>Schorsch</vorname>
             <adresse1>Röslistrasse 40</adresse1>
             <adresse2>Postfach</adresse2>
             <plz>8000</plz>
             <ort>Zureich</ort>
             <land>Schweiz</land>
         </kunde>
         <berater>
             <logo file="moz.jpg"/>
             <nachname>Müller</nachname>
             <vorname>Maria</vorname>
             <adresse1>Stauffacherstr. 106</adresse1>
             <adresse2/>
             <plz>8004</plz>
             <ort>Zureich</ort>
             <land>Schweiz</land>
             <firma>Arthur Andersen</firma>
             <tel_g>01 350 44 40</tel_g>
             <mobile>079 987 65 32</mobile>
             <email>maria.mueller@xxxxxxxxxx</email>
         </berater>
         <!-- a lot more tags in here -->
     </info>
     <!-- a lot more tags in here -->
 </page>

--/xml-snippet-----------------------------





xsl should look like this

--xsl-snippet------------------------------

<fo:table border-color="black" border-style="solid" border-width="1pt">
								<fo:table-column column-width="15cm"/>
	<fo:table-body font-size="12pt" font-family="sans-serif">
		<xsl:for-each select="//info/kunde">
			<xsl:for-each select="*">
			
			<fo:table-row>
			<fo:table-cell>
				<fo:block>
					<xsl:for-each select="."/>							<!--<xsl:text>dada</xsl:text>-->
				</fo:block>
										
			</fo:table-cell>								</fo:table-row>	
													</xsl:for-each>
		</xsl:for-each>
	</fo:table-body>
</fo:table>
 --/xsl-snippet-----------------------------
				


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




Current Thread
Keywords
xsl