472,982 Members | 2,202 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,982 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 1343
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: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.