com.sun.org.apache.xerces.internal.dom.ElementImpl 的替代方案

发布于 2024-12-19 04:20:56 字数 1001 浏览 0 评论 0原文

我正在开发一个使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

陌路终见情 2024-12-26 04:20:56

为什么不直接转换为

org.w3c.dom.Element

您不太可能需要 Xerces 实现中的任何属性,因此只需坚持使用 DOM API 类型,这就是您通过引用 org.w3c.dom.NodeList< 已经在做的事情/代码>

Why not just cast to

org.w3c.dom.Element

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

山川志 2024-12-26 04:20:56

允许使用该类的更好替代方案是添加对 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文