J
John Barleycorn
Hi
I'm sorry if this question is a bit basic for most people, but I'm really
new to VB (I'm using the .NET 2005 Express Edition), but I've set myself a
task and would love to see it through.
The problem is that an application we use has a config file which looks
XML-like and contains the following:
<design filerevision="1" fileversion="0">
<types>
<type name="Password" default="" inherits="Password" regex=""
regexsample="">
<values />
</type>
<type name="Text" default="" inherits="Text" regex="" regexsample="">
<values />
</type>
<type name="DN" default="" inherits="DN" regex="" regexsample="">
<values />
</type>
<type name="DNs" default="" inherits="DNs" regex="" regexsample="">
<values />
</type>
<type name="Check" default="" inherits="Check" regex="" regexsample="">
<values />
</type>
<type name="lstCountries" default="" inherits="combo" regex=""
regexsample="">
<values>
<value key="US">
</value>
<value key="AD">
</value>
<value key="AE">
</value>
<value key="AF">
</value>
<value key="AG">
</value>
<value key="AI">
</value>
<value key="AL">
</value>
<value key="AM">
</value>
</values>
</type>
</design>
The lstCountries node is list of iso country codes but sometimes they are
not sorted alphabetically and sometimes I don't want them all to be visible,
so I'm writing an app to resolve these problems. BUT I'm failing at the
first hurdle because I can't see how to read the config file and select JUST
the lstCountries values, putting them into a CheckedListBox.
If the node was simply called <countries> then I can select it but because
it's <type name=".... I can't figure out how to select just that section of
the file.
I suppose I'll have the same problem with the <value="... elements as well
but if I can solve the first problem I should be OK with that one!
Can anyone give me some pointers? Or better still, is there any code
available? I've trawled everywhere with no success!
Thanks.
JB
I'm sorry if this question is a bit basic for most people, but I'm really
new to VB (I'm using the .NET 2005 Express Edition), but I've set myself a
task and would love to see it through.
The problem is that an application we use has a config file which looks
XML-like and contains the following:
<design filerevision="1" fileversion="0">
<types>
<type name="Password" default="" inherits="Password" regex=""
regexsample="">
<values />
</type>
<type name="Text" default="" inherits="Text" regex="" regexsample="">
<values />
</type>
<type name="DN" default="" inherits="DN" regex="" regexsample="">
<values />
</type>
<type name="DNs" default="" inherits="DNs" regex="" regexsample="">
<values />
</type>
<type name="Check" default="" inherits="Check" regex="" regexsample="">
<values />
</type>
<type name="lstCountries" default="" inherits="combo" regex=""
regexsample="">
<values>
<value key="US">
</value>
<value key="AD">
</value>
<value key="AE">
</value>
<value key="AF">
</value>
<value key="AG">
</value>
<value key="AI">
</value>
<value key="AL">
</value>
<value key="AM">
</value>
</values>
</type>
</design>
The lstCountries node is list of iso country codes but sometimes they are
not sorted alphabetically and sometimes I don't want them all to be visible,
so I'm writing an app to resolve these problems. BUT I'm failing at the
first hurdle because I can't see how to read the config file and select JUST
the lstCountries values, putting them into a CheckedListBox.
If the node was simply called <countries> then I can select it but because
it's <type name=".... I can't figure out how to select just that section of
the file.
I suppose I'll have the same problem with the <value="... elements as well
but if I can solve the first problem I should be OK with that one!
Can anyone give me some pointers? Or better still, is there any code
available? I've trawled everywhere with no success!
Thanks.
JB