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

RE: xsl, position, template Problem

Subject: RE: xsl, position, template Problem
From: "Michael Kay" <mhkay@xxxxxxxxxxxx>
Date: Wed, 31 Jan 2001 11:49:36 -0000
xsl position
To process all the child nodes you must use <xsl:apply-templates> with a
select expression that processes all child nodes. Obviously //Stretchext
doesn't. (And why on earth are you using "//" here?)

If you want the position of a Stretchext counting only the Stretchext
elements, use <xsl:number>, or count(preceding-sibling::Stretchext)

Mike Kay

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Partho Paul
> Sent: 31 January 2001 10:52
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  xsl, position, template Problem
>
>
> I have the following xml given:
>
> <Para>
> Some useful Text
> <Stretchext>Bla Bla - some usefule thing</Stretchext>
> Another useful text
> <Stretchext>Bla Bla - some usefule thing</Stretchext>
> Further useful text
> </Para>
>
> The Probelm is, how to create a xsl Stylesheet?
>
> I used the following:
> ....
> <xsl:template match="Para">
> <xsl:apply-templates select="//Stretchtext"/>
> </xsl:template>
>
> <xsl:template match="Stretchtext"/>
> <xsl:value-of select="position()"/>
> </xsl:template>
> ---------------------------------------------------------
> Problem:
>
> The problem now is that the function postion() works well, but
> I don't get the output of the text from the xml File.
> If I do the following:
>
> <xsl:template match="Para">
> <xsl:apply-templates />
> </xsl:template>
>
> I do get the output of the texts, but now the function position()
> dos not count correctly.
>
> So how can I get the output of the text according to its occurance
> and count the Stretchtext-Tags correctly.
>
> Thank you.
>
> Partho
>
> ______________________________________________________________
> _________
> Partho Paul                     email: uk4u@xxxxxxxxxxxxxxxxxxx
> Computer science student        or:    paul@xxxxxxxxx
> --------------------------------------------------------------
> ---------
> Homepage:   http://www.partho.de
> Durga Puja: http://www.uni-karlsruhe.de/~uk4u/durga.html
>
>
>  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.