commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gao Di <jaoy...@yahoo.com.cn>
Subject [digester]parsing problem
Date Wed, 08 Sep 2004 07:09:49 GMT
my xml file is:
<?xml version='1.0' encoding='UTF-8'?>
<CMS>
  <CMD>
    <OBJ>
      <GATEWAY name='shanghai'>			
        <PARAMS num='5'>		
          <PR name='OSVER' value='V001'/>
          <PR name='HWVER' value='V002'/>
          <PR name='STATUS' value='ON'/>
          <PR name='CONNECTTIME' value='2004-08-30
16:50'/>
          <PR name='UPTIME' value='2004-08-30 16:50'
/>
        </PARAMS>	
     </GATEWAY>	
   </OBJ>
  </CMD>
 <CMD>
   <OBJ>
     <GATEWAY name='shanghai'>
       <IF name='lan'>		  
         <PARAMS num='4'>			<PR name='ADDRESS'
value='132.132.100.254'/>
	<PR name='TRAFFIC' value='2M/s'/>		<PR name='MASK'
value='255.255.255.0'/>
	<PR name='STATUS' value='ON'/>
         </PARAMS>
       </IF>
       <IF name='wan'>
         <PARAMS num='4'>
          <PR name='ADDRESS' value='132.132.100.188'/>
          <PR name='TRAFFIC' value='1M/s'/>
          <PR name='MASK' value='255.255.0.0'/>
          <PR name='STATUS' value='OFF'/>
         </PARAMS>
       </IF>
     </GATEWAY>				
   </OBJ>
 </CMD>
</CMS>	

and i have the digester rules:
digester.addObjectCreate("CMS/CMD/OBJ/GATEWAY",
"com.transfer.model.Device");
digester.addSetProperties("CMS/CMD/OBJ/GATEWAY");
digester.addSetProperty("CMS/CMD/OBJ/GATEWAY/PARAMS/PR","name","value");

when parsing,i got the
"java.lang.NoSuchMethodException: Bean has no property
named ADDRESS" error.

in fact,i only want the CMS/CMD/OBJ/GATEWAY/PARAMS/PR
mapping to the device object,but it seems the
CMS/CMD/OBJ/GATEWAY/IF/PARAMS/PR also adopt the rules.
and i have another object called If which i want to
bind with the following rules:
digester.addObjectCreate("CMS/CMD/OBJ/GATEWAY/IF",
"com.transfer.model.If");
digester.addSetProperties("CMS/CMD/OBJ/GATEWAY/IF");
digester.addSetProperty("CMS/CMD/OBJ/GATEWAY/IF/PARAMS/PR","name","value");
digester.addSetNext("CMS/CMD/OBJ/GATEWAY/IF",
"addIf");

is it impossible in this format xml?

_________________________________________________________
Do You Yahoo!?
150万曲MP3疯狂搜,带您闯入音乐殿堂
http://music.yisou.com/
美女明星应有尽有,搜遍美图、艳图和酷图
http://image.yisou.com
1G就是1000兆,雅虎电邮自助扩容!
http://cn.rd.yahoo.com/mail_cn/tag/1g/*http://cn.mail.yahoo.com/event/mail_1g/

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message