JDK-4762733 : Method setExpandEntityReferences of Object DocumentBuilderFactory has no effects
  • Type: Bug
  • Component: xml
  • Sub-Component: org.w3c.dom
  • Affected Version: 1.4.1
  • Priority: P4
  • Status: Closed
  • Resolution: Not an Issue
  • OS: windows_2000
  • CPU: x86
  • Submitted: 2002-10-14
  • Updated: 2019-01-11
  • Resolved: 2002-10-28
Related Reports
Relates :  
Relates :  
Description

Name: gm110360			Date: 10/14/2002


FULL PRODUCT VERSION :
java version "1.4.1"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-b21)
Java HotSpot(TM) Client VM (build 1.4.1-b21, mixed mode)

A DESCRIPTION OF THE PROBLEM :
DocumentBuilderFactory dbf =
DocumentBuilderFactory.newInstance();
dbf.setExpandEntityReferences( false );
DocumentBuilder db = dbf.newDocumentBuilder ();
Document myXmlDoc = db.parse( new File( xmlFile ) );

=> the external entities are always expanded

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. create an xml file with an external entity
2. write the program as described above
3. run the program

EXPECTED VERSUS ACTUAL BEHAVIOR :
I implement a subclass of DocumentHandler to report the
external entities => they are always expanded and the
parser is reading the content of the external entities.

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
see desciption
---------- END SOURCE ----------

CUSTOMER WORKAROUND :
would be nice to have a workaround
(Review ID: 164783) 
======================================================================

Comments
EVALUATION This is not a bug. The method setExpandEntityReferences() works well, using the JAXP in J2SE1.4.1-b21. Attached is a test case along with XML files to verify this. ###@###.### 2002-10-28
28-10-2002