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

RE: reading ascendants except the first one (NEWBIE)

Subject: RE: reading ascendants except the first one (NEWBIE)
From: "Andrew Welch" <awelch@xxxxxxxxxxxxxxx>
Date: Fri, 30 Aug 2002 11:51:32 +0100
xsl for each except
I think he needs the ancestor axis:

<xsl:for-each select="ancestor::*[position() > 1]">
    ...
 </xsl:for-each>

This will select all ancestors of the current node, except the very
first.

cheers
andrew

> -----Original Message-----
> From: TSchutzerWeissmann@xxxxxxxxxxxxxxxx
> [mailto:TSchutzerWeissmann@xxxxxxxxxxxxxxxx]
> Sent: 30 August 2002 11:20
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: RE:  reading ascendants except the first one (NEWBIE)
> 
> 
> Hi Thomas,
> 
> > -----Original Message-----
> > From: thomas [mailto:thomas.lohbeck@xxxxxx]
> > Sent: 30 August 2002 11:12
> > To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
> > Subject:  reading ascendants except the first one (NEWBIE)
> > 
> > 
> > Hello
> > I have the following xml:
> > -------------------------
> > .....more
> > <basisdaten>
> > 	<titel>Basisdaten zur Planungsrechnung</titel>
> > 	<kunde>
> > 		<titel>Personendaten</titel>
> > 		<vorname>Vorname</vorname>
> > 		<name>Name</name>
> > 		<adresse>Adresse</adresse>
> > 		<plz>Platz</plz>
> > 		<ort>Ort</ort>
> > 	</kunde>
> > </basisdaten>
> > .....more
> > -------------------------
> > 
> > I like to read the ascendants from the <kunde> element EXCEPT 
> > the first 
> > one:<titel>
> > It should be done with XPath right? I dont habe a clue!
> > I use the following xsl to generate the pdf
> > 
> > -------------------------
> > .....more
> > <fo:table>							
> > 		<fo:table-column column-width="10cm"/>		
> > 				 
> > <fo:table-body>						
> > 			<xsl:for-each 
> > select="//basisdaten/kunde">				
> 	 
> > <xsl:for-each select="*">					
> > 		<fo:table-row>					
> > 			 
> > <fo:table-cell>						
> > 				<fo:block>			
> > 							<xsl:value-of 
> > select="."/>						
> > </fo:block>							
> > 	</fo:table-cell>					
> > 		 
> > </fo:table-row>						
> > 			</xsl:for-each>				
> > 			 
> > </xsl:for-each>						
> > 			</fo:table-body>			
> > 				</fo:table>
> > ....more
> > -------------------------
> > 
> > it generates:
> > 
> > +-------------+
> > |Personendaten|
> > +-------------+
> > |Vorname      |
> > +-------------+
> > |Name         |
> > +-------------+
> > |Adresse      |
> > +-------------+
> > |Platz        |
> > +-------------+
> > |Ort          |
> > +-------------+
> > 
> > it should be:
> > +-------------+
> > |Vorname      |
> > +-------------+
> > |Name         |
> > +-------------+
> > |Adresse      |
> > +-------------+
> > |Platz        |
> > +-------------+
> > |Ort          |
> > +-------------+
> > 
> > thank you a lot
> > thomas
> > 
> > 
> >  XSL-List info and archive:  
> http://www.mulberrytech.com/xsl/xsl-list
> 
> You either miss out the first element, or <titel> elements:
> [...]
> > 			<xsl:for-each 
> > select="//basisdaten/kunde">				
> 	 
> > <xsl:for-each select="*">					
> > 		<fo:table-row>					
> 
> either 
> 	<xsl:for-each select="*[position() &gt; 1]">           
> - all but the
> first
> or
> 	<xsl:for-each select="*[not(self::titel)]">            - all but
> titel's
> 
> Good luck
> Tom
>  
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 
> 
> 
> 
> 
> ---
> Incoming mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.381 / Virus Database: 214 - Release Date: 02/08/2002
>  
> 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.381 / Virus Database: 214 - Release Date: 02/08/2002
 

 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.