Apache Axis的忽略/跳过额外的元素,而解析 [英] Apache AXIS Ignore/Skip additional element while parsing

查看:273
本文介绍了Apache Axis的忽略/跳过额外的元素,而解析的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们消耗第三方的Web服务。每当他们更新XML架构像添加新元素,我们得到了以下错误消息。

We consume the web service of third party. Whenever they update the XML schema like add the new element we got the following error message.

的SAXException:无效的元素。

"SAXException: Invalid Element ... "

有没有AXIS任何方式要求跳过XML获得额外的元素,而解析它?

Is there any way in AXIS to ask skip the additional element received on XML while parsing it?

早些时候,我用来接收XML如下

I have generated web service client using AXIS earlier i used to receive XML as below

<Flight>
   <AirlineCode>AB</AirlineCode> 
</Flight>

和一切工作正常。但现在我得到了额外的标签响应。

and everything was working fine. But now i am getting an additional tag in response.

<Flight>
   <AirlineCode>AB</AirlineCode> 
   <OtherCode>XX</OtherCode> 
</Flight>

和为我收到无效的元素异常。

And for that i am getting "Invalid Element" Exception.

感谢

推荐答案

的Apache Axis2的版本1.7.0-SNAPSHOT有能力的忽略与 -Eiu 开关编译的意外因素。

Apache Axis2 version 1.7.0-SNAPSHOT has the ability to ignore unexpected elements by compiling with the -Eiu switch.

<一个href=\"https://repository.apache.org/content/groups/snapshots/org/apache/axis2/axis2-$c$cgen/1.7.0-SNAPSHOT/\"相对=nofollow>为1.7.0-SNAPSHOT 下载

这篇关于Apache Axis的忽略/跳过额外的元素,而解析的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆