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 June 1st, 2007, 04:31 PM
Authorized User
 
Join Date: May 2007
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default traverse the whole tree without knowing the node

hi!
     I wanted to traverse each node without knowing the name of each of the node.
I am looking for specific text within two nodes but that text could appear within any node. I am only aware of text but not node, I need to write my xslt such that it find that term and create a new xml file using that text as node.
is it possible.?
thanks.

 
Old June 1st, 2007, 04:51 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

I suspect that by "node" you mean "element node".

//*[.='dipsut']

will return all the element nodes whose content is the string 'dipsut'

//*[contains(text(),'dipsut')]

will return all the element nodes whose content contains the string 'dipsut', within a single text node child of the element node.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old June 17th, 2011, 06:21 AM
Registered User
 
Join Date: Jun 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

How can I retrieve the node name by the attibute id ?

<xsl:value-of select ="//*[@id="$referencename"] returns the list of values within the node. Is a looping required to get the node name ?
 
Old June 17th, 2011, 07:49 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

Please don't add your questions to a three-year-old post - start a new thread.

You can write

Code:
name(//*[@id='xxx'])
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
how to traverse and than print result eruditionist XSLT 4 October 28th, 2008 01:15 PM
Not able to see the last tree view node suji C# 0 October 11th, 2008 12:34 AM
Search A Hierarchy Tree for Node where id=value sdaspen XSLT 4 February 2nd, 2007 06:34 PM
insert object into tree node Xeon-Yk C# 1 November 13th, 2006 12:06 PM
using hyperlink controls as node with tree control connect2sandep ASP.NET 1.0 and 1.1 Professional 0 October 27th, 2005 02:00 PM





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