473,386 Members | 1,748 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,386 software developers and data experts.

How to select a boolean from a XpathNavigator

Hi. I have ax xpath expression which returns a true or false. I don't know
which method to use from the XPathNavigator object to get the result.
There's not a ".SelectValue("xpath expression") method. Typically, I may use
..Select or .SelectSingleNode but I'm not returning a node or set of nodes?
Maybe I shouldn't be using a XPathNavigator? Please let me know if you have
any ideas.
Thanks!
--
Steve
Feb 19 '06 #1
2 1709
Hi Steve,

Use the XpathNavigator.Evaluate("XpathExpression") method. It will return an
Object variable, that you can convert to Boolean using CType.

HTH,

Regards,

Cerebrus.

"Steve" <sm*******@newsgroup.nospam> wrote in message
news:20**********************************@microsof t.com...
Hi. I have ax xpath expression which returns a true or false. I don't know which method to use from the XPathNavigator object to get the result.
There's not a ".SelectValue("xpath expression") method. Typically, I may use .Select or .SelectSingleNode but I'm not returning a node or set of nodes?
Maybe I shouldn't be using a XPathNavigator? Please let me know if you have any ideas.
Thanks!
--
Steve

Feb 19 '06 #2


Steve wrote:
I have ax xpath expression which returns a true or false. I don't know
which method to use from the XPathNavigator object to get the result.


Use the method Evaluate, its return type is the generic object, you can
then cast to the type you expect e.g. a bool in C#.

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Feb 19 '06 #3

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

Similar topics

1
by: Craig Pearson | last post by:
Hi My function receives an XPathNavigator object. From here I need to build a DataSet to load into SQL Server (using SQLXML adaptor). Does anyone have an idea on the most efficient way to...
5
by: Tim Menninger | last post by:
I have seen the postings about passing XML into an XSL transformation. The problem is that I cannot use any XPath navigation in the XSL that won't generate an error. If I use <xsl:copy-of...
1
by: Greg | last post by:
Is it possible to filter an XML document twice? I have filter 1, and later in the code I want to apply filter 2. Filter 2 should be based on the results from filter 1. I have tried using an...
2
by: Trillium | last post by:
This seems like it should be really easy, but I cannot seem to make it work. I am trying to retrieve the text value of an element named "child2Element" from an XML file in a .NET (v 1.1) with an...
12
by: David Thielen | last post by:
Hi; I have an element: <space> </space> When I call SelectSingleNode() on it, the InnerXml is a 0 length String, not a String containing 1 space. Any ideas?
2
by: JSheble | last post by:
I'm integrating with a customer application, and in their assembly, when I call a method it returns data to us as an XPathNavigator object. I can parse the various elements I need out of this...
11
by: ericms | last post by:
Can anybody show me how to insert a CDATA section using XPathNavigator ? I have tried the follwing with no luck: XmlDocument docNav = new XmlDocument(); docNav.LoadXml(xmlString);...
2
by: Jiho Han | last post by:
I have an xml document as follows: <?xml version="1.0" encoding="utf-8" ?> <entityConfiguration xmlns="http://schemas.infinityinfo.com/entityconfiguration" version="1.0"> <entity...
4
by: Bruce Sandeman | last post by:
Hi, Does anyone know how to serialize an XPathNavigator object? I have tried the following but it moans that the xpn does not have a parameterless constructor. XPathNavigator xpn =...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.