You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Iñigo Serrano <in...@wanadoo.es> on 2002/06/13 10:25:21 UTC

Problem parsing a XML document

I have a problem reading a XML document. The problem is that the parser tries to connect to the server that is indicated in the Doctype.
The XML document is this (Struts-config.xml)

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC
          "-//Apache Software Foundation//DTD Struts Configuration 1.0//EN"
          "http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd">

The code to read it is this

     DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
            domFactory.setValidating(false);
            DocumentBuilder domBuilder = domFactory.newDocumentBuilder();
            File fichero=new File("url");
            return domBuilder.parse(fichero);

And then the parser (Xerces using JAXP) tries to access jakarta.apache.org

How can i solve it?

Thank in advance

Iñigo Serrano
-------------------------------------
http://www.inigoserrano.com
http://isvalidator.sourceforge.net