Select inside resource files

  • Thread starter Thread starter Arjen
  • Start date Start date
A

Arjen

Hello,

I have 2 resource files.
The resource files have both inside the name field values.
I want to select from the first resource file the records where the name
field haves a value between 1 and 25.

Now I am doing this:
XmlDocument xdResx = new XmlDocument();
xdResx.Load("Resources.resx");
XmlNodeList xnlValues = xdResx.SelectNodes("root/data/value");

But this loads everything. Is there not a better way? Can you give me an
example?

After selecting I want to update the second resource file.
How can I query the resource file. (Like with SQL, update where name field
is...)

Thanks!
Arjen
 
You basically have the right idea. After selecting the nodes,
you need to examine each value and filter the ones you want;
that is 1< value< 25, so

foreach(Node node in XmlNodeList)
{ if(node.Value > 1 && node.Value <= 25)
{ // ... do something; }
}

To update the second resource file, I would
use xmldom, and selectNode, just like your
example.
 
Back
Top