Hi Kathy,
If you use an asterisk * then it will match to any node. If you use
double slash // then it will match to any depth. So the following XPath
will find any node at any depth with the name attribute you want.
//*[@name='test']
Hope that helps,
Matthew
--------------------
From: Kathy Burke <ka**********@attbi.com>
X-Newsreader: AspNNTP 1.50 (ActionJackson.com)
Subject: quick Xpath question please
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Message-ID: <#L**************@TK2MSFTNGP10.phx.gbl>
Newsgroups: microsoft.public.dotnet.xml
Date: Thu, 04 Sep 2003 14:27:39 -0700
NNTP-Posting-Host: actionjackson133.dsl.frii.net 216.17.147.133
Lines: 1
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP10.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.xml:15599
X-Tomcat-NG: microsoft.public.dotnet.xml
I'm trying to figure out how to do an xpath that simply looks for a
unique attribute name.
For example, select the node where the name attribute is
"test1"...regardless of which element. It would point to either of the
following -- depending on which one had the attribute name (which will
always be unique).
//Base/Station/Measure[@name='test1']
//Base/Station/Measure/Data[@name='test1']
Thanks.
Kathy
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
Note: For the benefit of the community-at-large, all responses to this
message are best directed to the newsgroup/thread from which they
originated.