You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2002/09/25 19:01:27 UTC
DO NOT REPLY [Bug 12997] New: -
Call the method as soon as the last parameter is encountered
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: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>