This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Fwd: BOUNCE xsl-list@lists.mulberrytech.com: Non-member submission from ["Jeni Tennison" <jeni@tennison.2ndmail.com>]


Another message from Jeni that bounced:

>Date: Tue, 8 May 2001 04:37:45 -0400 (EDT)
>From: owner-xsl-list@lists.mulberrytech.com
>To: xsl-list-approval@lists.mulberrytech.com
>Subject: BOUNCE xsl-list@lists.mulberrytech.com:    Non-member submission 
>from ["Jeni Tennison" <jeni@tennison.2ndmail.com>]
>X-Loop-Detect: 1
>
> >From jeni@tennison.2ndmail.com  Tue May  8 04:37:34 2001
>Received: from www.2ndmail.com (2ndmail.com [209.75.7.64])
>         by biglist.com (8.8.8/8.8.5/BL-2) with SMTP id EAA12434
>         for <XSL-List@lists.mulberrytech.com>; Tue, 8 May 2001 04:37:33 
> -0400 (EDT)
>Date: Tue, 8 May 2001 04:37:33 -0400 (EDT)
>Message-Id: <200105080837.EAA12434@biglist.com>
>Received: (qmail 71698 invoked from network); 8 May 2001 08:38:51 -0000
>Received: from localhost (HELO 2ndmail.com) (127.0.0.1)
>   by localhost with SMTP; 8 May 2001 08:38:51 -0000
>From: "Jeni Tennison" <jeni@tennison.2ndmail.com>
>To: "Sabine Lehmann" <slehmann@dfki.de>
>Cc: XSL-List@lists.mulberrytech.com
>Importance: Normal
>X-Mailer: VisualMail 3.05 ( http://www.mintersoft.com/visualmail )
>Subject: Re: [xsl] accessing specific elements
>Mime-Version: 1.0
>Content-type: text/plain; charset="iso-8859-1"
>
>Hi Sabine,
>
> > -     count the tokens which have a domlex[@attribute='location']
> >         (this is no problem, I just use
> > count(//domlex[@attribute='location'])"/>))
> >
> > -     access only those tokens with an [@attribute='location'],  so that
> > I can express
> >         the condition: "If the first element with  @attribute='location'
> > and the third have the same
> >         value, then write out only one as the origin (and the middle one
> > as the destination).
> >
> > I thought of storing the value of the first in a variable and
> > comparing it with subsequent ones... but I can't get it work...
>
>You can store them in a variable like:
>
><xsl:variable name="locs"
>   select="/input_stream/chunk/token/domlex[@attribute = 'location']" />
>
>(I step down from the root rather than using the descendant axis as
>it's likely to be more efficient - you might want to check the path to
>make sure it's right for your source XML.)
>
>The $locs variable now contains three nodes - the three domlex
>elements with the @attribute attribute equal to 'location'.  When you
>index into a node set like this, then their positions (as indicated in
>positional predicates like [1]) are relative to the other nodes in the
>node set.  So you can get the first with $locs[1], the second with
>$locs[2] and the third with $locs[3].
>
>So you should be able to use the following to get the kind of output
>that you're after.
>
>    Origin: <xsl:value-of select="$locs[1]/@value" />
>    <xsl:choose>
>       <xsl:when test="$locs[1]/@value = $locs[3]/@value">
>          Destination: <xsl:value-of select="$locs[2]/@value" />
>       </xsl:when>
>       <xsl:otherwise>
>          Via: <xsl:value-of select="$locs[2]/@value" />
>          Destination: <xsl:value-of select="$locs[3]/@value" />
>       </xsl:otherwise>
>    </xsl:choose>
>
>I hope that helps,
>
>Jeni
>
>(this is a temporary address due to mailing problems - please use 
>mail@jenitennison.com)
>
>Jeni Tennison
>http://www.jenitennison.com
>
>======================================================
>
>The most personalized email addresses available!
>at: http://www.2ndmail.com
>Say goodbye to that boring email address.
>
>======================================================


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]