Reputation: 153
I am trying to read xml using Apache commons configuration
this is my sample xml file
<tu tuid="chan@">
<note>Label for iCare OLTP administration.</note>
<prop type="maxlength">75</prop><prop type="minlength">1</prop>
<tuv lang="ES-ES">
<seg>Programa, tarjetas, cupones y reglas</seg>
</tuv>
</tu>
this is my java code:
List<ConfigurationNode> tuvNode = element.getChildren("tuv");
List<ConfigurationNode> segNode = tuvNode.get(0).getChildren("seg");
System.out.println(segNode.get(0).getValue());
out put is:
Programa
Actually it is working.problem is when it has "," then it doesn't give rest of other values.i need whole value.any one can give idea. my expected out put is:
Programa, tarjetas, cupones y reglas
i really appreciate
thanks
Upvotes: 2
Views: 258
Reputation: 153
@ guillaume girod-vitouchkina Thanks for your Idea
we have set value like that initialize Configuration object with no arguments
config = new XMLConfiguration();
Then disable delimiter
config.setDelimiterParsingDisabled(true);
after that give xml file name
config.load(filename);
after that rest of code
useful linkdoc
Upvotes: 0
Reputation: 3079
',' is interpreted as a value separator.
try this:
setDelimiterParsingDisabled(true); // to disable parsing list of properties.
more details here: apache commons configuration loads property until "," character
Upvotes: 1