Re: [xsl] How to select a node with parents?

Subject: Re: [xsl] How to select a node with parents?
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 13 May 2005 09:19:52 +0100
> And I want to select a specific employee node but get all the parent
> nodes along with it... for example...

You can't do that with a single xpath(*) as you don't want the parent
(ancestor) nodes as the children of a node are an intrinsic property of
the node, and you wnat nodes with different children, therefore you need
to create new nodes with the same names and attributes but different
children. So you need template invocation for that.

* I put a note here as because in XSLT2 you can in priinciple do
  everything in a single XPath as you can wrap up any nu,berr of
  apply-template or other xsl instructions into an xsl:function and then
  call that function from XPath, but in order to create new nodes you
  must use the xsl instruction <xsl:element or ,xsl:copy or a literal
  result element at some point.

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

Current Thread