如何过滤 StAX XMLStreamReader
我需要连接一个接收 StAX XMLStreamReader
作为输入的 API,并过滤提供的流(将某个属性的值从 true 更改为 false)。
查看了 StreamReaderDelegate
,但对于这个,我必须进行大量编码才能跟踪相关属性的所有访问路径。
有更好的办法吗?
提前致谢!
I need to hook into an API that receives a StAX XMLStreamReader
as the input, and filter the supplied stream (change the value of a certain attribute from true to false).
Looked at StreamReaderDelegate
, but with that one I'd have to do a lot of coding to keep track of all access paths to the attribute in question.
Is there a better way?
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 StAX,您可以改用事件 API 并利用 EventReaderDelegate。但代码量大致相同。使用委托也是推荐的解决方案,所以恐怕没有更好的方法。
With StAX, you could use the event API instead and utilize the EventReaderDelegate. The amount of code would be roughly the same though. Using delegates is also the recommended solution, so I'm afraid, there is no significantly better way.