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 April 9th, 2007, 04:59 PM
Registered User
 
Join Date: Apr 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default help in selecting elements

I have an xml that is a tree of various elements that repeat within each other i.e.

RF
-RU
--RSS
--RF
---RU
---RSS
... and so on

what I want to do is just get all the rss elements and their children, but there xpaths are different, and have not been able to find a generic one that will just give me all the RSS elements + the children regards of where it is in the xml. any one have any ideas

trying something like this, which does not work

<xsl:template match="/">
   <xsl:apply-templates/>
</xsl:template>


<xsl:template match="RSS/RF">
           <xsl:copy>
           <xsl:value-of select="normalize-space(.)"/>
           <xsl:apply-templates select="@* | node()"/>
           </xsl:copy>
    </xsl:template>


thanks for any help you might be able to offer.
 
Old April 9th, 2007, 07:27 PM
Friend of Wrox
 
Join Date: Jul 2006
Posts: 430
Thanks: 28
Thanked 5 Times in 5 Posts
Send a message via Yahoo to bonekrusher
Default

Try:

<xsl:apply-templates select="//RSS"/>

Here is a good tutorial site:

http://www.w3schools.com/xpath/xpath_syntax.asp

I also recommend
XSLT 2.0 Programmer's Reference, 3rd Edition
(http://www.wrox.com/WileyCDA/WroxTit...764569090.html)

and
XPath 2.0 Programmer's Reference
http://www.wrox.com/WileyCDA/WroxTit...764569104.html





Similar Threads
Thread Thread Starter Forum Replies Last Post
Selecting Elements at Runtime to Display using XSL pnviv XSLT 1 November 22nd, 2007 05:08 AM
Selecting multiple elements from the source XML mkansal XSLT 15 June 18th, 2007 09:40 AM
Selecting unique set of elements Chamkaur XSLT 1 March 15th, 2007 05:43 AM
Selecting elements up until a certain one Frode XSLT 5 January 19th, 2006 01:22 PM
selecting certain xml elements fogofogo XML 2 December 5th, 2005 07:33 AM





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