解析连字符xml标记

时间:2013-09-28 10:29:55

标签: java apache-commons-digester

有人可以解释我如何使用commons digest解析带连字符的xml标签。我一直在网上搜索但没有运气帮我解决这个问题

<foo id="1">...
    <bar> 
      <foo-ref id="1"/> 
    </bar>
</foo> 

1 个答案:

答案 0 :(得分:0)

这个怎么样?

digester.addObjectCreate("foo-ref", "mypackage.FooRef");

http://commons.apache.org/proper/commons-digester/guide/core.html#doc.Usage

相关问题