Iterative Searches

Topics: Developer Forum
Feb 16, 2007 at 9:26 AM
Hi,

Is it possible to write iterative searches? For example, given the following dummy config:

<configuration>
<configSections>
<configSection name="abc" ...>
<configCache .../>
...
</configSection>
<configSection name="xyz" ...>
<configCache .../>
...
</configSection>
...
</configSections>
...
</configuration>

... would it be possible to say that every "configSection" nade must have a child node "configCache."

It seems this may be possible by having something along these lines (where we navigate to the configSection Node on the substitution rule, and then go inwards from there on the Query):

<Setting Key1="XmlProp" Key2="configuration/configSections/configSection" Substitution="ConfigSection">
<Rule Name="sWebConfigConfigCacheChildCheck" Query="./configCache"/>
</Setting>

<Object Type="Group" Name="Hosted Scenario Rules" Tasks="Hosted">
<Object Type="Group" Name="My Rules">
<Rule Name="fWebConfigConfigCacheChildCheck" Query="matches(null, %ConfigSection%)"
Error="Error" .../>
</Object>
</Object>

It's not very obvious and I suspect this isn't possible.... any ideas???

Many Thanks
David White