解析时将从 xml 响应中获取值,但我无法获取值
下面的代码是来自服务器的响应:
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><SendCardDetailsResponse xmlns="http://tempuri.org/"><SendCardDetailsResult><ROOT xmlns=""><DocumentElement><res-auth><auth-data count='1' ><**attribute name='OTP1'** length='6' type='N' label='OTP' prompt='Please enter OTP as send to your mobile.'/></auth-data></res-auth></DocumentElement></ROOT></SendCardDetailsResult></SendCardDetailsResponse></soap:Body></soap:Envelope>
我必须获取属性名称“OTP1” 如何获取属性名称的值 任何帮助都会很明显
Below code is the response from the server:
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><SendCardDetailsResponse xmlns="http://tempuri.org/"><SendCardDetailsResult><ROOT xmlns=""><DocumentElement><res-auth><auth-data count='1' ><**attribute name='OTP1'** length='6' type='N' label='OTP' prompt='Please enter OTP as send to your mobile.'/></auth-data></res-auth></DocumentElement></ROOT></SendCardDetailsResult></SendCardDetailsResponse></soap:Body></soap:Envelope>
I have to fetch attribute name which is 'OTP1'
how can I get value of attribute name
any help will be appreciable
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我会这样使用:
这里没什么难的,如果出现一些关于代码的问题,只需查看我在这里使用的函数的文档。
也许还有更有效的方法,不知道。它对我来说就像一种魅力。
I would use smth like this:
Nothing hard here, if some questions about the code appear, just see the documentation for the functions i've used here.
maybe there are more efficient ways, dunno. It works like a charm for me.