commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oliver Heger <oliver.he...@oliver-heger.de>
Subject Re: [configuration] Issue with combinedConfig from Factory
Date Wed, 14 Jun 2006 19:14:07 GMT
thomas peter wrote:
> hi,
> i stumbled across the following issue, and don't know what knob to turn.
> 
> i load configs (xml) via the getConfiguration Method of
> ConfigurationFactory and cast it to CombinedConfiguration.
> the file i provide to the Factory is
> <configuration>
>     <xml fileName="c.xml"/-->
> </configuration>
> 
> c.xml has something like that:
> <root>
>   <v type="one">
>     <some>blah</some>
>     <thing>bla</thing>
>   </v>
>   <v type="one">
>     <some>moreblah</some>
>     <thing>muchbla</thing>
>   </v>
>   <v type="two">
>     <some>different blah</some>
>     <thing>different blub</thing>
>   </v>
> </root>
> 
> when i only include c.xml everything works fine, and i get 3 iterations
> of the following for-loop:
> for (int i=0;; i++){
>   if(!config.containsKey("v.("+i+")[@type]")){
>     break;
>   }
> }
> and i can access all three v-nodes (and their children)
> 
> but if i include another xml-file via
> <configuration>
>     <xml fileName="c.xml"/>
>     <xml fileName="c-additional.xml"/>
> </configuration>
> 
> while c-additional.xml only holds
>   <v type="something">
>     <some>asdf</some>
>     <thing>asd</thing>
>   </v>
> 
> the first occurence of <v type="one"> node has been merged with all
> other nodes that are named <v type="one">
> 
> is this inteded behaviour?
> can i switch it off?
> i know there is the <additional> tag for the main-condig.
> but my nodes are in the same file.
> 
> any hints?
> thanx in advance,
> thomas
> 
Not sure what happens here, but a combined configuration certainly does 
no merging based on attribute values. What exactly is the output of the 
loop? Did you try what happens if you use the <additional> tag?


Oliver

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message