Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

如何在java中获取如下xml返回的相关值?

0 views
Skip to first unread message

xeoshow

unread,
Feb 28, 2011, 12:30:50 AM2/28/11
to
本来想用xpath方式统一获取 cname节点的值,但是第二个<com.domain.Products>节点的<cla__id>却是reference的方式,如何得到其值呢?谢谢。
-------
<list>
<com.domain.Products>
<cla__id>
<cla__id reference=".."/>
<cname>class1</cname>
<id>1</id>
</cla__id>
<name>pname1</name>
<id>1</id>
</com.domain.Products>

<com.domain.Products>
<cla__id reference="../../com.domain.Products/cla__id"/>
<name>pname2</name>
<id>2</id>
</com.domain.Products>
</list>
-------
--

[m [36m※ 来源:·水木社区 http://newsmth.net·[FROM: 202.108.130.*] [m

0 new messages