473,395 Members | 1,823 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

xpath - how to get an element name?

I'm using the following xpath in .net

//Station[@name="Station1"]/WI/Boards/Board[@sn="12345"][not(@finish)]")

to test if there is a Board element with NO "finish" attribute.

If there is, I need to get the @title of the WI element...but haven't
been able to figure it out yet (and yes, I do user XpathVisualizer!).

Also, how can I test if the above xpath results in no/null nodeset? It
doesn't seem to work for me unless I first set an attribute.value
string to test (e.g., Dim unfinished As String =
n1.Attributes.GetNamedItem("start").Value).

Thanks for any help!

Kathy
Nov 11 '05 #1
3 4192

"KathyB" <Ka**********@attbi.com> wrote in message
news:75**************************@posting.google.c om...
I'm using the following xpath in .net

//Station[@name="Station1"]/WI/Boards/Board[@sn="12345"][not(@finish)]")

to test if there is a Board element with NO "finish" attribute.

//Station[@name="Station1"]/WI[Boards/Board[@sn="12345"][not(@finish)"] ]/@t
itle
=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL
Nov 11 '05 #2
Kathy,

your problem is that you are not using XSLT.

In XSLT one can use keys to achieve efficiency.

Yes, this may be done just using DOM, but I don't believe you are
masochistic.

Please, read a good book on XSLT and XPath -- you need to really go deep
into these matters. The newsgroups provide answers to random questions. They
are not a substitute for a systematic basic introduction into the
subject-matter.
=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL
"Kathy Burke" <ka**********@attbi.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Thanks, Dimitri,

I was also wondering if I'm doing the following in the most efficient
way:

I actually need to get the @doc of the preceding-sibling station for the
selected WI.

First, I get the preceding station:

//Station[@name="Station2"]/preceding-sibling::Station[1]
(create a varStation string = Station1)

then, I get the WI[@doc] to load as mentioned earlier.

//Station[@name='" & varStation &
"']/WI[Boards/Board[@sn="583730"][not(@finish)]]/@doc

Any way to combine these actions??? Just wondering. Thanks.
Kathy
Kathy

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 11 '05 #3
Dimitre,

For this purpose, I am NOT using xslt, but xpath within an asp.net
application.

thanks anyway.

Kathy

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 11 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: bdinmstig | last post by:
I refined my attempt a little further, and the following code does seem to work, however it has 2 major problems: 1. Very limited support for XPath features Basic paths are supported for...
5
by: Tom Alsberg | last post by:
Hi there... I'm recently trying to get a bit acquainted with XML Schemas and XSL. Now, I have a few questions about XSL stylesheets and templates: * Is there a way to "enter" a child element...
4
by: Clarence | last post by:
Hi - I have a problem and here is the verbose version of what I am trying to do (better too much info than not enough). I am searching through about 4,700 XML files containing company contact...
3
by: David Elliott | last post by:
I am in the process of creating an application to scrape databases in order to create typed DataSets. One of the last pieces that I need to do is to remap database fields to something more...
1
by: Hollywood | last post by:
I have the following XSD created in VS.NET 2003: <?xml version="1.0" encoding="utf-8" ?> <xs:schema id="ReferralSchama" targetNamespace="http://test.org/Referral"...
5
by: David Thielen | last post by:
Hi; I set up my xml as follows: XmlDocument xml = new XmlDocument(); xml.Load(File.Open("data.xml", FileMode.Open, FileAccess.Read)); XmlNamespaceManager context = new...
3
by: Goran Djuranovic | last post by:
Hi All, Does anyone know how to retreive deepest XPath value from XML document by using VB.NET? For example, if I had an XML file like this: <Root> <Customer> <Name>MyName</Name> </Customer>...
0
by: Torsten Munkelt | last post by:
Hi, I want to write an XML-schema saying that this document <root> <edge type="special"> <target type="one"/> </edge> <edge type="special"> <target type="one"/>
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.