Using C# to search several xml files using the least amount of memory as possible?

S

SirPoonga

I know I could take all the xml files and loaded them into a single
XmlDocument and then use xpath to search for nodes. However, is there
a way that would work but not use up so much memory?

I am integrating an rss reader into a program. I'd like the ability
to keyword search titles and descriptions. While a simple xpath can
get initial results what if I search for something like "car in
traffic"? Ideally all articles that have "car" and/or "traffic" would
show. "In" should probably be dismissed. Any ideas on a good xml
search engine/technique?
 
S

SirPoonga

Well, I want to search the xml that the new reader has downloaded.
This means it can be searching data that current rss feeds don't have.
 
S

SirPoonga

I think I know how. I can search the xml file using regular
expressions. This way I don't have to load the file into a
XmlDocument object
 
S

SirPoonga

I need a little help witht he regex expressions. I want to find all
item nodes where the description or title contain the search word.

Here's the first thing I tried
"(<item>(.*?)((<description>(.*?)[[searchword]](.*?)</description>)|
(<title>(.*?)[[searchword]](.*?)</title>))(.*?)</item>)"
I replace [[searchword]] with the word I am going to search.

If I have the xml of "<item><title>Cool</title></
item><item><title>Hot</title></item>" and hte search word is hot it
will return the entire string. I need to know how to pair matching
tags in regex.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top