Show full path to all tags in xml (xslt newbie)

Discussion in 'XML' started by Critcho, Sep 6, 2010.

  1. Critcho

    Critcho

    Joined:
    Sep 6, 2010
    Messages:
    2
    I have a stack of xml documents (total size about 1MB!), I would like to get a listing of all the tags, in node1.node2.tag format, value would be nice too. I have done a few basic xsl transforms before, but from what I have seen, it will only show the final tag name.

    e.g.
    Code:
    <xsl:for-each select="Node1/Node2/Node3/*">
    		<tr>
    			<td><xsl:value-of select="Tag"/></td>
    		</tr>
    </xsl:for-each>
    Will produce
    Code:
    Tag1
    Tag2
    Tag3
    Whereas I want
    Code:
    Node1.Node2.Node3.Tag1
    Node1.Node2.Node3.Tag2
    Node1.Node2.Node3.Tag2
    The branch depth will vary, anywhere from tags in the top node to maybe 10 nodes deep.
    E.g.
    Code:
    Node1.Tag1
    Node1.Tag2
    Node1.Node2.Tag3
    Node1.Node2.Tag4
    Node1.Node2.Node3.Tag5
    etc 
    Does anyone know a method for this? Perhaps xslt is not the correct engine.

    Thanks for your help,
    Cheers,
    Critcho.
    Critcho, Sep 6, 2010
    #1
    1. Advertising

  2. Critcho

    Critcho

    Joined:
    Sep 6, 2010
    Messages:
    2
    Never mind, I started thinking about it too much... so I wrote a macro in XL, looks like it is working fine. Contact me if you want a copy.
    Critcho, Sep 6, 2010
    #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. Rob Nicholson
    Replies:
    3
    Views:
    684
    Rob Nicholson
    May 28, 2005
  2. Mike
    Replies:
    3
    Views:
    865
    Michael Borgwardt
    Jan 9, 2004
  3. strutsng@gmail.com
    Replies:
    1
    Views:
    573
    Evertjan.
    Sep 30, 2005
  4. dude
    Replies:
    5
    Views:
    1,690
    Jussi Piitulainen
    Mar 17, 2011
  5. strutsng@gmail.com
    Replies:
    1
    Views:
    168
    Evertjan.
    Sep 30, 2005
Loading...

Share This Page