How to get listing of all sectionGroups in defined subnode of Web.config file?

  • Thread starter Thread starter Frank
  • Start date Start date
F

Frank

Hi folks,

based on the Web.config snapshot on bottom I would like to know how to
get a listing of elements in a defined level. Let's assume I would like
to get a list of all sectionGroup elements within the sectionGroup
called "TopLevel". How to do that?

I tried to define the "type" attribute of the sectionGroup elements to
link it to an own settingsHandler, but unfortunately this is not
possible using .Net 1.1.

How to proceed?

Thanks, Frank

<configuration>
<configSections>
<sectionGroup name="TopLevel">
<sectionGroup name="Level1">
<section name="Level1.A" tpye="myOwnSettingsHandler"/>
<section name="Level1.B" tpye="myOwnSettingsHandler" />
</sectionGroup>
<sectionGroup name="Level2">
<section name="Level2.A" tpye="myOwnSettingsHandler"/>
<section name="Level2.B" tpye="myOwnSettingsHandler"/>
</sectionGroup>
<sectionGroup name="Level3">
<section name="Level3.A" tpye="myOwnSettingsHandler"/>
<section name="Level3.B" tpye="myOwnSettingsHandler"/>
</sectionGroup>
</sectionGroup>
</configSections>
</configuration>
 
Why not just treat the web.config like any other XmlDocument and use xPaths?

Karl
 
Back
Top