com.sun.org.apache.xerces.internal.dom.ElementImpl 的替代方案
我正在开发一个使用 SharePoint 列表中的数据的 java 应用程序(在 netbeans 中)。我按照本教程从 SharePoint 检索数据: http://davidsit.wordpress.com/2010/02/10/reading-a-sharepoint-list-with-java-tutorial/
好处是,它有效。坏消息是,我收到一条似乎无法修复的警告。
浓缩片段:
Lists service = new Lists();
ListsSoap port = service.getListsSoap();
GetListItemsResponse.GetListItemsResult result = port.getListItems(
"myListName", "", null, null, "9999", null, "" );
Object resultNode = result.getContent().get( 0 );
NodeList list = ((com.sun.org.apache.xerces.internal.dom.ElementImpl)data)
.getElementsByTagName( "myTag" );
正是这最后一行,导致了以下警告:
warning: com.sun.org.apache.xerces.internal.dom.ElementImpl
is Sun proprietary API and may be removed in a future release
显然,我需要找到此 ElementImpl 类的替代方案。我尝试谷歌搜索,查看文档,但没有发现任何有用的东西。
任何帮助将不胜感激。
I'm working on a java application (in netbeans) that uses data in a SharePoint list. I follow this tutorial to retrieve data from SharePoint: http://davidsit.wordpress.com/2010/02/10/reading-a-sharepoint-list-with-java-tutorial/
The good thing is, it works. The bad news is, I get a warning which I can't seem to fix.
a condensed snippet:
Lists service = new Lists();
ListsSoap port = service.getListsSoap();
GetListItemsResponse.GetListItemsResult result = port.getListItems(
"myListName", "", null, null, "9999", null, "" );
Object resultNode = result.getContent().get( 0 );
NodeList list = ((com.sun.org.apache.xerces.internal.dom.ElementImpl)data)
.getElementsByTagName( "myTag" );
It is this last line, that is causing the following warning:
warning: com.sun.org.apache.xerces.internal.dom.ElementImpl
is Sun proprietary API and may be removed in a future release
Obviously, I need to find an alternative to this ElementImpl class. I tried googling, looking at docs, but haven't found anything useful.
Any help would be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
为什么不直接转换为
您不太可能需要 Xerces 实现中的任何属性,因此只需坚持使用 DOM API 类型,这就是您通过引用
org.w3c.dom.NodeList< 已经在做的事情/代码>
Why not just cast to
It is very unlikely, that you need any property from the Xerces implementation, so just stick with the DOM API types, which is what you're already doing by referencing
org.w3c.dom.NodeList
允许使用该类的更好替代方案是添加对 jaxp-ri 库的依赖项,并从 jar 而不是 jre 内部导入该类。
https://mvnrepository.com/artifact/com.sun.xml。解析器/jaxp-ri
A better alternative which allows using the class is adding a dependency to jaxp-ri library and importing the class from the jar instead of jre internal.
https://mvnrepository.com/artifact/com.sun.xml.parsers/jaxp-ri