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

Getting an IXPathNavigator's Document

I'm trying to do the functional equivalent of IsNodeDocument(IXPathNavigable
myNode, IXPathNavigable potentialRoot), but I can't seem to get any
comparisons that will work. If I use MoveToRoot(), I lose the state of
myNode, but SelectAncestors(XPathNodeType.Root, true/false) won't work on an
attribute.
Aug 20 '06 #1
5 1356
Keith Patrick wrote:
I'm trying to do the functional equivalent of IsNodeDocument(IXPathNavigable
myNode, IXPathNavigable potentialRoot), but I can't seem to get any
comparisons that will work.
If I use MoveToRoot(), I lose the state of
myNode,
You can always clone current node - that's the recommended way.

but SelectAncestors(XPathNodeType.Root, true/false) won't work on an
attribute.
SHould work I think. Select("/") will work anyway.
--
Oleg Tkachenko [XML MVP, MCPD]
http://blog.tkachenko.com | http://www.XmlLab.Net | http://www.XLinq.Net
Aug 20 '06 #2
That works, thanks. Do you happen to know if "/" is defined as a constant
somewhere in the BCL? I'ver searched some of the XPath namespace for one
but couldn't find one.

Aug 20 '06 #3
Keith Patrick wrote:
That works, thanks. Do you happen to know if "/" is defined as a constant
somewhere in the BCL? I'ver searched some of the XPath namespace for one
but couldn't find one.
/ is defined as root node in XPath. See
http://www.w3.org/TR/xpath#location-paths

--
Oleg Tkachenko [XML MVP, MCPD]
http://blog.tkachenko.com | http://www.XmlLab.Net | http://www.XLinq.Net
Aug 21 '06 #4
I mean in the sense that there's a declaration:
public const String RootNode = "/";
somewhere in the BCL (i.e. System.Xml.XPath.XPathExpression). FxCop will
generally flag magic strings, and I have a const already defined, but if
there's a BCL-defined constant for the root node, I'd rather use it.

Aug 21 '06 #5
Keith Patrick wrote:
I mean in the sense that there's a declaration:
public const String RootNode = "/";
somewhere in the BCL (i.e. System.Xml.XPath.XPathExpression). FxCop will
generally flag magic strings, and I have a const already defined, but if
there's a BCL-defined constant for the root node, I'd rather use it.
No, I don't think there is such constant. It's just XPath expression.

--
Oleg Tkachenko [XML MVP, MCPD]
http://blog.tkachenko.com | http://www.XmlLab.Net | http://www.XLinq.Net
Aug 22 '06 #6

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

Similar topics

15
by: middletree | last post by:
How do I request the actual page name that I'm on? This is going to go into an include file, and depending on which page I'm on, I'd like to do different things. I'm looking for "pagename.asp"
1
by: Martin | last post by:
There seems to be some strange behaviour when trying to get the scrollHeight and scrollTop of an iframe in IE6. I have tried several ways of getting these values when the iframe is written into...
5
by: s_m_b | last post by:
function saveState() { document.write (" | <a href = 'myhomepage.asp? view=mhp&amp;action=save&amp;pb="); >> document.write (document.phone.style.display.value); document.write ("'>save view</a>"); };...
1
by: kamleshsharmadts | last post by:
I am using Ajax with struts in web application. from jsp i am calling a function of ajax.js onclick of a button. code of that call function which calling from jsp given as below:- ...
1
by: bagya | last post by:
please help me out the following is the small code i have <html> <head> <script type="text/javascript"> function validate() { if (document.abc.region.value==0)
3
by: scripter199 | last post by:
Hi, Im adding textboxes dynamically from an onclick event that calls the function below: function addRowDynamic() { rowCnt++; lookupCnt++; id++; //add a row to the rows...
1
by: simbarashe | last post by:
Hie could someone please help me with getting and using the current page url. I have a function that gets the url, I want to use it with header(location : XXX) but it wont work. The code is as...
1
by: raghuvendra | last post by:
Hi I have a jsp page with 4 columns: namely Category name , Category order, Input field and a submit button. All these are aligned in a row. And Each Category Name has its corresponding Category...
2
by: saketmayur | last post by:
Hi , I have write the following code to open word document on server using Microsoft.Office.Interop.Word; string DocPath = System.Configuration.ConfigurationManager.AppSettings; ...
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...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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,...

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.