mhm, sorry.. just to be more clear. Is there a way in Commons Digester to trigger a method only if a xml element has a child ?
i.e. digester.addCallMethod("collection/doc/categ/*", "myMethod", 0); This doesn't work. But it is actually what I need. If element <categ> has at least a child, then trigger myMethod thanks On 13 May 2011 18:48, Patrick Diviacco <patrick.divia...@gmail.com> wrote: > I need to print the content of <categ> in my XML file (including children > tags). > > For example, if I have <categ><child></child></categ>, I want to print > "<child></child>" > > I'm currently parsing the xml file with: > digester.addCallMethod("collection/doc/categ", > "checkCateg", 0); > > and this is the checkCateg function: > public void checkCateg(String categ) { > System.out.println(categ); > } > > It doesn't work. The string categ is always empty because it only contains > text content in <categ> but not its children tags. > > thanks, > Patrick >