[jdom-interest] setExpandEntities and XMLOutputter behaviour

Manish Sharan manish.sharan at divlogic.com
Wed May 5 07:56:52 PDT 2004

When I set saxBuilder.setExpandEntities(false)  and  output the docment
using XMLOutputter, the XMLOutputter includes all the external DTDs 
within the Doctype declaration. This does not happen when
setExpandEntities(true) is used.

I am aware that an XML parser will by default load the external DTD files
but Is there a way to ensure that the XMLOutputter does not include them
(the external DTDs)in its output.


ps :  This is the section of the output
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" [
   Extensible HTML version 1.0 Transitional DTD

   This is the same as HTML 4 Transitional except for
   changes due to the differences between XML and SGML.

   Namespace = http://www.w3.org/1999/xhtml

   For further information, see: http://www.w3.org/TR/xhtml1

   Copyright (c) 1998-2002 W3C (MIT, INRIA, Keio),
   All Rights Reserved.

   This DTD module is identified by the PUBLIC and SYSTEM identifiers:

   PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"

   $Revision: 1.2 $
   $Date: 2002/08/01 18:37:55 $

  <!--================ Character mnemonic entities
  <!ENTITY %HTMLlat1 PUBLIC "-//W3C//ENTITIES Latin 1 for XHTML//EN"
  <!-- Portions (C) International Organization for Standardization 1986
     Permission to copy in any form is granted for use with
     conforming SGML systems and applications as defined in
     ISO 8879, provided this notice is included in all copies.
  <!-- Character entity set. Typical invocation:
       "-//W3C//ENTITIES Latin 1 for XHTML//EN"
  <!ENTITY nbsp " ">
  <!-- no-break space = non-breaking space,
                                  U+00A0 ISOnum -->
  <!ENTITY iexcl "¡">

More information about the jdom-interest mailing list