[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: Re: [xsl] regarding variables and axis


Subject: Re: Re: [xsl] regarding variables and axis
From: "Laura Jenkins" <xsl_list@xxxxxxxxxxx>
Date: Fri, 22 Mar 2002 16:36:36 +0000


Hi Willaim

forgive me for my newbie question.. i was not very much successful in writing the xpath expression to get to the childelement1. could you please help me getting the expression. i tries weird expressions like preceding-sibling[parent::childelement].. I know i am wrong at the expression.. but my idea was to get the preceding sibling of the parent of childelement any suggestions in this regard is appreciated

<xsl:value-of select="parent::childelement/preceding-sibling::childelement1/text()"/>


or as Markus suggested..
<xsl:value-of select="../../childelement1/text()"/>


--laura--


From: "william locksman" <vsd18@xxxxxxxxxxxxxx>
Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: Re: [xsl] regarding variables and axis
Date: 22 Mar 2002 16:12:14 -0000

Hello Cutlass

when node context is <name/>


use parent::  to get to childelement and/or combine with
preceding:: in your
select statement to get to childelement1


forgive me for my newbie question..
i was not very much successful in writing the xpath expression to
get to the childelement1.
could you please help me getting the expression.
i tries weird expressions like
preceding-sibling[parent::childelement]..
I know i am wrong at the expression.. but my idea was to get the
preceding sibling of the parent of childelement
any suggestions in this regard is appreciated
bill



On Fri, 22 Mar 2002 cutlass wrote :

----- Original Message ----- From: "william locksman" <vsd18@xxxxxxxxxxxxxx>


> > Dear members > The following are my questions.

Hello William,

> 1.Will unnecesary variable declaration contribute to any
overhead
> in terms of processing performance etc??

well, if they are unneccesary u dont need to use them ? any use
of them will
cause an overhead, no matter how slight.

> 2.if i have an xml structure like this:
>
> <root>
>   <parentelement>
>     <childelement1>text in child1</childelement1>
>     <childelement>
>        <name></name>
>     </childelement>
>   </parentelement>
> </root>
>
> If context node is <name>(i got there through a for loop),then
how
> do i print the text in <childelement1>

when node context is <name/>

use parent::  to get to childelement and/or combine with
preceding:: in your
select statement to get to childelement1

> i understand ancestor would not get me to childelement1..
> how do i then reach to main element..
>
> alternatively i thought of a solution of getting there
through
> ancestor::parentelement/childelement1/text()

if u only need to go up to the parent, then this statement will
take up more
processing time which increases with the overall size of your xml
doc.

gl, jim fuller

>
> It works but i am not sure if it is the right way to do it.
>
> any suggestions regarding this ??
> many thanks in advance
> Bill
>
>  XSL-List info and archive:
http://www.mulberrytech.com/xsl/xsl-list
>


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



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



_________________________________________________________________
Join the world?s largest e-mail service with MSN Hotmail. http://www.hotmail.com



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




Current Thread
Keywords