gpt4 book ai didi

java - 解析钛合金中的xml

转载 作者:行者123 更新时间:2023-12-02 07:01:50 24 4
gpt4 key购买 nike

我有来自服务器的响应数据。我需要从 XML 中提取结果内容值。

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<Response xmlns="http://tempuri.org/">
<Result>Token1234567890</Result>
</Response>
</soap:Body>
</soap:Envelope>

我尝试使用 getElementsByTagName('Response').text;

如何获取结果的元素内容(Token1234567890)?

最佳答案

替换

getElementsByTagName('Response').text;

getElementsByTagName('Response').innerXML;

这是一个 XML 文档。

关于java - 解析钛合金中的xml,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16561348/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com