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

Joined
Sep 6, 2010
Messages
2
Reaction score
0
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.
 
Joined
Sep 6, 2010
Messages
2
Reaction score
0
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,534
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top