简体   繁体   English

如何使用Jsoup从SOAP响应中解析XML元素

[英]How to parse XML element from SOAP response using Jsoup

I'm having problem in parsing XML element returned by SOAP because the XML structure is like this : 我在解析SOAP返回的XML元素时遇到问题,因为XML结构是这样的:

    <a:journey>
    <a:infantprice>0</a:infantprice>
    ...
    </a:journey>

I have tried 我努力了

.select("journey")
.select("a:journey")

But still not getting the xml value. 但仍然没有获得xml值。 Is it possible to select the XML segment with that format using Jsoup? 是否可以使用Jsoup选择具有该格式的XML段?

Thanks in Advance 提前致谢

I think, I got the answer for my question. 我想,我得到了我的问题的答案。

I should use : 我应该用:

.select("a|journey");

According to the documentation : 根据文件:

ns|tag: find elements by tag in a namespace, eg fb|name finds elements ns | tag:在命名空间中按标签查找元素,例如fb | name查找元素

Source : http://jsoup.org/cookbook/extracting-data/selector-syntax 资料来源: http//jsoup.org/cookbook/extracting-data/selector-syntax

Thanks 谢谢

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM