使用摘要器解析xml属性 [英] parse xml attribute using digester
本文介绍了使用摘要器解析xml属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
现在,当我使用摘要器解析xml属性时遇到问题.我能够解析节点文本内容,但无法解析属性值.
这是我的代码.
hi ,
Right now I''m facing problems while I parse attributes of an xml using digester. I''m able to parse node text content but I''m not able to parse attribute value.
here is My code.
Digester digester = new Digester();
digester.addObjectCreate("root/child",Child.class);
digester.addSetProperties("root/child","name","name");
digester.parse(new File("c:\\test.xml");
预先感谢.
Thanks in advance.
推荐答案
已阅读 ^ ].
它应该可以帮助您回答您的问题.不幸的是,您实际上并没有提供足够的信息来确切知道您要拧的位置.在oyu点添加代码,尝试读取XML的内容会有所帮助.
Have a read of this[^].
It should help you in answerign your question. Unfortunately, you haven''t really provided enouh information to know exactly where you are going wring. Adding the code at the point oyu try read the content of the XML would help.
这篇关于使用摘要器解析xml属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文