Thanks, it works all fine now with external and internal entities. Vincent -----Message d'origine----- De: Gary L Peskin [mailto:[EMAIL PROTECTED]] Date: jeudi 7 juin 2001 15:09 �: [EMAIL PROTECTED] Objet: Re: Pb with the DOM2DOM sample : it doesn't work when I'm using internal or external entities Vincent -- The short answer to this is that the JAXP DocumentBuilderFactory created by Xerces is initialized with isExpandedEntityReferences() set to false. Xalan will not work with this setting since it requires that entity references be expanded. Therefore, change the DOM2DOM source code by commenting out: Document xmlDoc = dBuilder.parse("birds.xml"); and replacing it with dFactory.setExpandEntityReferences(true); Document xmlDoc = dFactory.newDocumentBuilder().parse("birds.xml"); To add to the confusion, the DocumentBuilderFactory included with Xalan, though never actually instantiated, does set the isExpandedEntityReferences() to true. This is also indicated in the javadoc. Shane -- As part of xml-commons, you (or someone) will need to reconcile these two versions. The official spec (http://java.sun.com/xml/jaxp-1_1-spec.pdf) on page 41 shows the default value set to true so that would seem to indicate that the Xalan version is correct and the Xerces version is incorrect. I have filed bugzilla bug 2049 with the XercesJ folk. Gary MAHE Vincent FTRD/DIH/REN wrote: > > Hello all Xalan gurus, > > I've tried the DOM2DOM sample with an XML file containing one internal and > one external entities. > > The DOM output is serialized well but it doesn't contain any value of my > entities. > > Could you tell me why ?
