Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Alternative to com.sun.org.apache.xerces.internal.dom.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.

like image 496
Daan Avatar asked Dec 12 '22 07:12

Daan


1 Answers

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

like image 96
Lukas Eder Avatar answered Dec 25 '22 18:12

Lukas Eder