[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: to get the descendants at only one level - xpath

Subject: Re: to get the descendants at only one level - xpath
From: "Senthil Nathan" <rsennat@xxxxxxxxx>
Date: Wed, 6 Feb 2008 23:57:47 +0530
Re:  to get the descendants at only one level - xpath
Actually I'm giving the xpath query to the libxml2 library and it
returns everything under that path for that query.
/root/level1/child::*

I tried the other solution also, /root/level1/* which also does the same.

Senthil

On 2/6/08, David Carlisle <davidc@xxxxxxxxx> wrote:
>
>
> > I need to select only child1, 2, 3 and not any of the childs of these.
>
> no it just selects child1 child2 child3, depending what you do with
> child3 having selected it you may see the descendents.
>
> so for example select="/root" just selects a single element, if you call
> name() on it you just get a single string "root" but if you say
> <xsl:copy-of select="/root"/>
> you get the whole document tree back as child nodes are properties of an
> element so the copied node has copies of the same children.
>
> perhaps ypu want
> <xsl:for-each select="/*/*/*"
>  <xsl:copy/>
> </xsl:for-each>
>
> note that the selection is as previously suggested, but I'm guessing how
> you want to use the selected nodes (using <xsl:copy/>) you haven't shown
> how you have used them or what you want to generate, so I can only guess.
>
> David
>
>
> ________________________________________________________________________
> The Numerical Algorithms Group Ltd is a company registered in England
> and Wales with company number 1249803. The registered office is:
> Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.
>
> This e-mail has been scanned for all viruses by Star. The service is
> powered by MessageLabs.
> ________________________________________________________________________

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.