path to node as a string

Discussion in 'XML' started by shaun, May 17, 2005.

  1. shaun

    shaun Guest

    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
     
    shaun, May 17, 2005
    #1
    1. Advertising

  2. In article <>,
    shaun <> 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
     
    System Administrator, May 17, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. wolf
    Replies:
    0
    Views:
    565
  2. Replies:
    0
    Views:
    1,570
  3. Tjerk Wolterink
    Replies:
    2
    Views:
    1,459
    Dimitre Novatchev
    Aug 24, 2006
  4. jiing
    Replies:
    0
    Views:
    2,361
    jiing
    Apr 27, 2007
  5. Peter Mueller
    Replies:
    6
    Views:
    4,626
    Stefan Ram
    Jan 13, 2008
Loading...

Share This Page