commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Chow <>
Subject Digester rules problem.
Date Thu, 06 Oct 2011 03:02:07 GMT

<response query=",v2p,3,1,0" result="true">

    <attribute name="ip"></attribute>

    <attribute name="slot">3</attribute>

    <attribute name="port">1</attribute>

    <attribute name="status">active</attribute>

In the above XML, I have a bean as following:

public class Response {
   private String query;
   private boolean result;

   private String ip;
   private String slot;
   private String port;
   private String status;



For the query, result,  I can easy to use the following codes to parse.

Digester digester = new Digester();
digester.setNamespaceAware( true );
digester.setXIncludeAware( true );

digester.addObjectCreate( "response", Response .class );
digester.addSetProperties( "response", "query", "query" );
digester.addSetProperties( "response", "result", "result" );

But, how can I set those <attribute/> into the related properties?

Please help.


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message