469,623 Members | 1,365 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,623 developers. It's quick & easy.

Select inside resource files

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

Nov 16 '05 #1
2 1630
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.

--

This posting is provided "AS IS" with no warranties, and confers no rights.
"Arjen" <bo*****@hotmail.com> wrote in message
news:c8**********@news1.tilbu1.nb.home.nl...
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


Nov 16 '05 #2
Hi,

What wrong with this?
xdResx.SelectNodes("root/data/[value>1]/value");

Thanks!

"S. Han" <@> schreef in bericht news:40********@news.microsoft.com...
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.

--

This posting is provided "AS IS" with no warranties, and confers no rights.

"Arjen" <bo*****@hotmail.com> wrote in message
news:c8**********@news1.tilbu1.nb.home.nl...
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



Nov 16 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

16 posts views Thread by Chris Shearer Cooper | last post: by
1 post views Thread by TisMe | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.