How to catch Attribute-events with a StAX XML-parser?

左心房为你撑大大i 提交于 2019-12-03 14:44:22

You can obtain the attributes when you are in the START_ELEMENT state. See the getAttribute* methods on XMLStreamReader:

The whole ATTRIBUTEs even is an odd thing, and as Blaise mentioned, they are not separately reported when using event-based interface. This because attributes are "part of" start element, and need to be handled as such by parsers (to verify uniqueness, bind namespaces etc).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!