This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: fixed position
- To: xsl-list at lists dot mulberrytech dot com
- Subject: RE: [xsl] fixed position
- From: Wendell Piez <wapiez at mulberrytech dot com>
- Date: Thu, 02 Aug 2001 11:24:24 -0400
- Reply-To: xsl-list at lists dot mulberrytech dot com
Meltem,
I think you'll find that Jim's latest is the neatest solution, and should
work fine.
Note that his observation that your original problem is somewhat
underspecified is also correct, so you may have to make allowances for that
if your input data is not always exactly what you expect. (You could
validate ahead of time to prevent this -- note that DTD validation won't do
it, though XML-Schema might -- or even perform some exception-checking
within your XSLT.)
Cheers,
Wendell
At 03:05 AM 8/2/01, you wrote:
>Thanks for the replies. I will try them all. I will give you an update later
>today on that.
>
>Meltem
>
>-----Original Message-----
>From: James Melton [mailto:james.melton@cylogix.com]
>Sent: Wednesday, August 01, 2001 9:57 PM
>To: xsl-list@lists.mulberrytech.com
>Subject: Re: [xsl] fixed position
>
>
>Oops as always I have missed something. The first example does not work
>in every case. Instead try:
>
><xsl:template match="/">
> <xsl:for-each select="data/item[text() != 'Solution']">
> <xsl:value-of select="." />
> <xsl:text> </xsl:text>
> <xsl:if test="position() = 3">
> <xsl:text>Solution </xsl:text>
> </xsl:if>
> </xsl:for-each>
></xsl:template>
======================================================================
Wendell Piez mailto:wapiez@mulberrytech.com
Mulberry Technologies, Inc. http://www.mulberrytech.com
17 West Jefferson Street Direct Phone: 301/315-9635
Suite 207 Phone: 301/315-9631
Rockville, MD 20850 Fax: 301/315-8285
----------------------------------------------------------------------
Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list