commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 12997] New: - Call the method as soon as the last parameter is encountered
Date Wed, 25 Sep 2002 17:01:27 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12997>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12997

Call the method as soon as the last parameter is encountered

           Summary: Call the method as soon as the last parameter is
                    encountered
           Product: Commons
           Version: Nightly Builds
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Digester
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: smanux@lfjr.net


The method invocation of a CallMethodRule rule is fired only when the end of the
element is encountered, even if all parameters were already known after parsing
the beginning of the element. It becomes an issue if the parsing relies on the
order of the elements in the XML file.

for example with this XML file :

1  <toplevel>
2    <element name="A">
3      <element name="B">
4        <element name="C"/>
5      </element>
6    </element>
7  </toplevel>

and the following rules :

StringBuffer sequence = new StringBuffer();
digester.push(sequence);
digester.addCallMethod("*/element", "append", 1);
digester.addCallParam("*/element", 0, "name");

When the first element is encountered on line 2, all parameters needed to satify
the CallMethodRule are available, but the method will no be called until the end
of the element on line 6 is reached. There is the same issue with the second
element on line 3. Eventually the sequence contains "CBA" instead of "ABC" as
expected.

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message