Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parent and XSL

Status
Not open for further replies.

LeeGath

Programmer
Jun 3, 2002
13
GB
Could someone please help I've hit a bit of a stumbling block. I'm traversing through a set of nodes(Y) which has a parent(X). Whilst in the context of Y can I find the current position and last value of X.

I've tried things like parent::*position(). I'm sure it's possible but just need pointing in the right direction.

Thanks
 
Why don't try <xsl:value-of select &quot;ancestor(.)&quot;>.
It might help...

Try also a google search on xselerator, it's a nice ide for xslt (windows).

[red]Nosferatu[/red]
We are what we eat...
There's no such thing as free meal...
once stated: methane@personal.ro
 
Oooops... Err...
wrong syntax and wrong answer...

You can address nodes as elements of an array using xpath statements and you also have the last keyword.

However, I couldn't obtain the right output, if no node names are specified in the path (i.e. trying the generalized:
<xsl:value-of select=&quot;ancestor[last()]&quot;/>.

For a nice XPath syntax explanation, try a search on msdn for XPath Examples as the article title, it might help.

HalToH... :) (hope at least this one helps) [red]Nosferatu[/red]
We are what we eat...
There's no such thing as free meal...
once stated: methane@personal.ro
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top