This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: reading ascendants except the first one (NEWBIE)
- From: TSchutzerWeissmann at uk dot imshealth dot com
- To: xsl-list at lists dot mulberrytech dot com
- Date: Fri, 30 Aug 2002 11:20:07 +0100
- Subject: RE: [xsl] reading ascendants except the first one (NEWBIE)
- Reply-to: xsl-list at lists dot mulberrytech dot com
Hi Thomas,
> -----Original Message-----
> From: thomas [mailto:thomas.lohbeck@ksc.ch]
> Sent: 30 August 2002 11:12
> To: XSL-List@lists.mulberrytech.com
> Subject: [xsl] 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() > 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