473,516 Members | 2,865 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problems Navigator Select

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 XPathNavigator:
XPathDocument xpDocument = new XPathDocument(MyXMLFile);
XPathNavigator xpNavigator = xpDocument.CreateNavigator();

XPathExpression xpeExpr= xpNavigator.Compile(FilterSelectString)
XPathNodeIterator oNavigatorResults = xpNavigator.Select(xpeExpr);

//Later I try something like
XPathExpression xpeExpr2= xpNavigator.Compile(FilterSelectString2)
XPathNodeIterator oNavigatorResults2 =
oNavigatorResults.Current.Select(xpeExpr2)

The behavior is: it doesn't remember the original filter expression. It
acts as if it does a completely new query that is only the second
expression. Any advice much appreciated!


Nov 12 '05 #1
1 1402
Greg wrote:
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 XPathNavigator:
XPathDocument xpDocument = new XPathDocument(MyXMLFile);
XPathNavigator xpNavigator = xpDocument.CreateNavigator();

XPathExpression xpeExpr= xpNavigator.Compile(FilterSelectString)
XPathNodeIterator oNavigatorResults = xpNavigator.Select(xpeExpr);

//Later I try something like
XPathExpression xpeExpr2= xpNavigator.Compile(FilterSelectString2)
XPathNodeIterator oNavigatorResults2 =
oNavigatorResults.Current.Select(xpeExpr2)


You forgot to call MoveNext() on oNavigatorResults before accessing its
Current property.
--
Oleg Tkachenko [XML MVP]
http://blog.tkachenko.com
Nov 12 '05 #2

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

Similar topics

3
561
by: Marri Suliez | last post by:
I am trying to run the asp xpath examples from the QuickStarts samples, but I am not having any luck. When I run the code in a console app it works fine. When I run the same exact code in an aspx page it doesn't work. Here's a condensed example of what I am talking about. If I run this code in a console app the "count" variable will have...
3
981
by: Marri Suliez | last post by:
I am trying to run the asp xpath examples from the QuickStarts samples, but I am not having any luck. When I run the code in a console app it works fine. When I run the same exact code in an aspx page it doesn't work. Here's a condensed example of what I am talking about. If I run this code in a console app the "count" variable will have...
2
1255
by: suhy | last post by:
Hi All, I use bellow code for Auto-Sizing Image Popup Window. It seems that it just stop working OK with IE7 as I didn't make any changes ... In the FF2.0 it still works great. You can see the sample at : http://www.delko.si/modelarstvo/traxxas/nitro/revo.htm Thanks for your help ! I use the following code : <script>
2
10069
by: Randy | last post by:
Hi, I'm trying to figure out some binding navigator code. If I have the primary field value as selected by the user in a combo box, how can I instruct the binding navigator to move to that record. Here is what I have so far: Dim strSQL As String strSQL = "SELECT OrderID WHERE OrderID = @OrderID" Dim cmdSelect As New SqlCommand(strSQL,...
0
7276
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7182
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7548
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5714
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5110
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3259
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1624
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
825
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
488
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.