[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
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. > ________________________________________________________________________
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|