Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > path to node as a string

Reply
Thread Tools

path to node as a string

 
 
shaun
Guest
Posts: n/a
 
      05-17-2005
Is it possible in XSLT to get the path to the current node as a string,
maybe change one element and then navigate to the new resulting string?

e.g.
I have two documents I want to merge. The root element has a different
name in each ("structure" and "values") but otherwise the trees -up to
the final leaf nodes- are the same.
I want to visit the nodes in "structure" and use the path to visit the
same nodes in "values", then insert the leaf nodes of values into
structure.

cheers

shaun
 
Reply With Quote
 
 
 
 
System Administrator
Guest
Posts: n/a
 
      05-17-2005
In article <(E-Mail Removed)>,
shaun <(E-Mail Removed)> wrote:

>I want to visit the nodes in "structure" and use the path to visit the
>same nodes in "values", then insert the leaf nodes of values into
>structure.


Rather than constructing a complete xpath, I suggest that in each
template you maintain a variable pointing to the corresponding node in
the other document, which you pass as a parameter to the template.
Then use the position() of the current node to get the corresponding
child in the other document.

-- Richard
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
find path from one tree node to another tree node Peter Mueller Java 6 01-13-2008 02:36 AM
How to find node in TreeView by using string(the same as Node.Text) ? jiing ASP .Net 0 04-27-2007 02:34 AM
xsl variable $node/text() but $node can non-node-set help! Tjerk Wolterink XML 2 08-24-2006 03:28 AM
How to set the node indent property between the parent node and the leaf node viveknatani@gmail.com ASP .Net 0 02-13-2006 07:11 PM
How to drag a sub-node to another node in TreeView? wolf ASP .Net 0 08-18-2004 11:51 PM



Advertisments