If I run a document with an entity declaration in it through an identity transform, just with something like

transformer = transformerFactory.newTransformer();
transformer.transform(new SAXSource(reader, new InputSource(inputStream)), streamResult);

(reader is an XMLReader)

it mangles the entity declaration, dropping the space between the % and the name. (Which give me an error when I try to run the result through Xerces). So something that starts like

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE material [
<!ENTITY % ISOlat1 SYSTEM 'http://www.tei-c.org/Entity_Sets/Unicode/iso-lat1.ent'>
%ISOlat1;
]>
<someRoot>stuff</someRoot>

get changed to
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE material [
<!ENTITY %ISOlat1 SYSTEM "http://www.tei-c.org/Entity_Sets/Unicode/iso-lat1.ent"; >
]>
<someRoot>stuff</someRoot>

(FWIW, I reintroduced equivalent line breaks)

This was with Xalan 2.7.2 and Xerces 2.11. I also tried with Xalan 2.7.1 and Xerces 2.10 and the same thing happened.

Is there some explanation for this other than there is really a bug? (I'm just hesitant to believe there is a bug like this after all these years.)

Thanks,

Eric

Reply via email to