473,386 Members | 1,798 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.

MergeFilterQuery gobbles up the whole document!

I've got a custom XPathNavigator that encapsulates a stream. I'm using
xpath expressions to seek forward to various positions within the stream.
Using a limited set of xpaths, I can get my stream to move forward only (no
backward seeks). This works fine until a filter expression is introduced,
at which point the entire stream is read before the first selection is
returned. I've traced the problem to the System.Xml.XPath.MergeFilterQuery
class, who's implementation of advance() makes a list of all matches in the
document before returning the first one. I can clearly see that this method
could have been coded differently, so that each call would have cursored
forward to the next match. This would be more consistent with the behaviour
of the other IQuery implementations.

To illustrate how strange this is, consider the following long xml document:

<list>
<item/>
<item/>
<!-- a million more item elements here -->
</list>

If I select on the xpath expression "/list/item[1]", MergeFilterQuery will
check all one millon item elements against the filter expression "[1]"
before returning the first one!

Now I'm faced with having to throw out the entire dotnet xpath selection
mechanism in favour of coding it myself or modifying Rotor, all due to the
implementation decisions in an internal sealed class! Does anyone have any
suggestions on how I might override this behaviour? Is there any way to
have this issue looked at for dotnet 2.0?

Steve Taylor
Nov 12 '05 #1
1 1083
Steve Taylor wrote:
Now I'm faced with having to throw out the entire dotnet xpath selection
mechanism in favour of coding it myself or modifying Rotor, all due to the
implementation decisions in an internal sealed class! Does anyone have any
suggestions on how I might override this behaviour? Is there any way to
have this issue looked at for dotnet 2.0?


Take a look at XPathReader project:
http://msdn.microsoft.com/XML/defaul...ml05192004.asp
http://workspaces.gotdotnet.com/xpathreader
--
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
by: datactrl | last post by:
Hi, all How do I know the whole text of an INPUT element is selected? Jack
3
by: meyer.dominik | last post by:
Hi there! I'm a newbie in XSLT, so maybe this problem is easy to solve, but I just don't get it and hours of searching for an answer didn't help me either. Is there any possibility to print a...
2
by: Chucker | last post by:
Hi folks, I would like to select some nodes from a very large XML document and then apply a stylesheet to the dom fragment / nodelist that is the result of my XPath-Query. I used to use MSXML...
0
by: Nata | last post by:
hi all i am trying to store the XML Document object into MS SQL2005 i want to store this as whole not different tables; plz help me regarding this i am trying form last two weeks i asked many...
4
by: ctchrinthry | last post by:
I have some large and complex XML documents. I want to return the whole document with some sections trimmed away. Right now, i read the whole document into some python code, walk the tree, snip...
2
by: Björn Langhof | last post by:
Hello. I want to evaluate a XPath-Expression only on a subtree of the whole xml-document. 1. I select a node of the XML-document 2. Then a want to select specific nodes below the node chosen...
3
by: sameer | last post by:
Hi all, ..net framwork 1.1 sql server 2000 I have a vb.net winforms application using webservices\ remoting to upload documents\ images to the webserver and i am gong to store them in the sql...
19
by: vunet.us | last post by:
Hello, My AJAX application paints data into about 500 cells with unique ID every 10 seconds. I am using document.getElementById() to find the right cell. However, I have noticed that...
8
by: Martin Honnen | last post by:
VK wrote: Mozilla has document.height document.width IE has scrollHeight/scrollWidth, depending on compatMode you will need these properties of document.documentElement or document.body --
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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
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
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.