Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XSLT
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 9th, 2007, 04:59 PM
Registered User
 
Join Date: Apr 2007
Location: , , .
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.
Reply With Quote
  #2 (permalink)  
Old April 9th, 2007, 07:27 PM
Friend of Wrox
Points: 1,676, Level: 16
Points: 1,676, Level: 16 Points: 1,676, Level: 16 Points: 1,676, Level: 16
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2006
Location: , , .
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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 11:31 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.