Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 3rd, 2006, 09:08 AM
Registered User
 
Join Date: Aug 2006
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Printing the heirarchy!

Hi All,
 I wanted to do the following:
Input XML
---------
<data>
<details>
  <name>xslt</name>
  <version>2.0</version>
  <vendor>saxon</vendor>
</details>
</data>

Is there is a way using XSLT to generate the output:
---------
xslt is at /data/details/name
2.0 is at /data/details/version
saxon is at /data/details/vendor
---------

Thanks.

Free
 
Old August 3rd, 2006, 09:21 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

<xsl:for-each select="//*[not(*)]">
  <xsl:value-of select="., 'is at', string-join(ancestor-or-self::*/name(), '/')"/>
</xsl:for-each>

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old August 3rd, 2006, 10:00 AM
Registered User
 
Join Date: Aug 2006
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you so much for the reply!

Free





Similar Threads
Thread Thread Starter Forum Replies Last Post
Does anyone have an example. Printing fbailey VS.NET 2002/2003 0 December 9th, 2006 06:03 PM
Help about printing Fahim Crystal Reports 0 November 12th, 2006 11:14 PM
Printing Arunachalam Beginning VB 6 2 October 12th, 2006 07:44 AM
Printing Arunachalam Crystal Reports 0 July 23rd, 2006 07:05 AM
capturing printing settings when printing reports nikolaosk Access VBA 0 February 8th, 2005 04:14 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.