java - Problems using commons digester to parse subversion XML output -
the subversion xml formatted output combination of attribute , elements - particularly within <path>
element - see sample below:
<?xml version="1.0" encoding="utf-8"?> <log> <logentry revision="29"> <author>bob</author> <date>2013-02-14t17:21:42.848605z</date> <paths> <path action="a" kind="dir" copyfrom-path="/trunk" copyfrom-rev="28">/tags/tag-0.1</path> </paths> <msg>creating tag tag-0.1</msg> </logentry> </log>
i'm trying use commons digester parse log content 2 different pojo's (logentry , path) using following:
arraylist<logentry> logentries = new arraylist<logentry>(); digester.push(logentries); digester.addobjectcreate("*/logentry", logentry.class); digester.addsetproperties("*/logentry"); digester.addbeanpropertysetter("*/logentry/author"); digester.addbeanpropertysetter("*/logentry/date"); digester.addbeanpropertysetter("*/logentry/msg"); digester.addsetnext("*/logentry", "add"); digester.addobjectcreate("*/logentry/paths/path", path.class); digester.addsetproperties("*/logentry/paths/path"); digester.addbeanpropertysetter("*/logentry/paths/path", "value"); digester.addsetnext("*/logentry/paths/path", "addpath");
(note addpath adds path object being created onto arraylist<path>
within created logentry object)
i can't figure out why path class not being populated. based upon xml can understand why copyfrom-rev
, copyfrom-path
attributes might not getting copied (due hyphen) corresponding copyfromrev attributes.
but can't see reason why kind
attribute isn't being set within path.
does have ideas?
i need use digester.addsetproperties()
call copyfrom-path
, copyfrom-rev
attributes populated:
digester.addsetproperties("*/logentry/paths/path", "copyfrom-path", "copyfrompath"); digester.addsetproperties("*/logentry/paths/path", "copyfrom-rev", "copyfromrev");
however reason kind attribute still isn't being populated.
Comments
Post a Comment