开发者

How do i create methods from the parsed values from the xml file

开发者 https://www.devze.com 2023-01-10 05:00 出处:网络
I have parsed an xml fileusing the digester parser, now i need to create a method like If I have a <productlist>

I have parsed an xml file using the digester parser , now i need to create a method like

If I have a

              <productlist>
                  <products> </products>
                  .
                  ..

              </productlist>

findP开发者_运维技巧roducts() should give me all the subelements with all the attributes

How do i do this ..

Thanks


I am assuming Java... try this:

 digester.addObjectCreate("productlist", ArrayList.class);
 digester.addCallMethod("productlist/products", "add", 1);
 digester.addCallParam("productlist/products", 0);
0

精彩评论

暂无评论...
验证码 换一张
取 消