commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Borut BolĨina <>
Subject [configuration] Unexpected behavior
Date Sun, 20 Nov 2005 16:20:16 GMT

when having an attribute value with commas in XML configuration file, 
this value gets splitted. An example:

<?xml version="1.0" encoding="UTF-8"?>
    <set week="42" text="Questions for first week">
        <question text="First question, something after comma.">   <=== 
                <answer>(I) 1.a</answer>
                <answer correct="true">(I) 1.b</answer>
                <answer>(I) 1.c</answer>
        <question text="Second question, which includes comma in the 
sentence.">   <=== offending
                <answer correct="true">(I) 2.a</answer>
                <answer>(I) 2.b</answer>
                <answer>(I) 2.c</answer>

When calling this method

     * @return all questions from XML configuration file
    public Collection<String> getQuestions() {
        String ofQuestions = "set.question[@text]";
        return config.getList(ofQuestions);

the returned list contains *four* instead of two questions:
1.) First question
2.) something after comma
3.) Second question
4.) which includes comma in the sentence

Is this by design? I think this should not work this way.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message