Allora:
Io sto cercando di fare un parser xml con DOM. HO trovato un esempio online e ho voluto provarlo
ad un certo punto l'esempio arriva qui:
codice:
...
public void parseAndPrint(String uri) // uri = nome del doc, // es. mydoc.xm
{
Document doc = null;
try
{
DOMParser parser = new DOMParser(); // Nuovo parser parser.parse(uri);
doc = parser.getDocument(); // Restituisce il doc
}
catch (Exception e)
{ System.err.println(”Error: " + ...
etc...
Quando dichiaro l'oggetto DOMParser eclipse fra i vari import mi aggiunge in automatico:
codice:
import com.sun.org.apache.xerces.internal.parsers.DOMParser;
il quale mi genera il seguente errore
codice:
Type Access restriction: The type DOMParser is not accessible due to restriction on required library C:\Programmi\Java\jre6\lib\rt.jar