Donate Share

Saxon XSLT and XQuery Processor

Tracker: Bugs

5 Duplicate DOCTYPE declaration - ID: 581515
Last Update: Settings changed ( mhkay )

Hi Michael,

When using Saxon's identity transformer, with following
output keys:

format.put(OutputKeys.DOCTYPE_PUBLIC,"x");
format.put(OutputKeys.DOCTYPE_SYSTEM,"y");
format.put(OutputKeys.METHOD,"html");

Emitter outputs DOCTYPE twice, because
writeDocType called twice.

First time from:
HTMLEmitter.startDocument
Outputter.open
GeneralOutputter.setOutputDestination
IdentityTransformerHandler.startDocument, 97

and second time from:
HTMLEmitter.startDocument
ContentEmitter.startDocument
IdentityTransformerHandler.startDocument, 104


Not sure how this should be resolved, but I patched
XMLEmitter.java so it has check for second call:

------8<------
boolean docTypeWritten = false;
protected void writeDocType(...) {
if (docTypeWritten) return;
docTypeWritten = true;
------8<------


This bug present in Saxon 6.5.2 too.

Vadim


Vadim Gritsenko ( vgritsenko ) - 2002-07-15 02:56

5

Closed

Fixed

Nobody/Anonymous

None

v6.5.2

Public


Comments ( 2 )

Date: 2002-08-28 13:16
Sender: mhkayProject Admin

Logged In: YES
user_id=251681

Fixed in 7.2, still present in 6.5.2


Date: 2002-07-25 16:25
Sender: mhkayProject Admin

Logged In: YES
user_id=251681

Confirmed as a bug. It can happen both with the
IdentityTransformer and the IdentityTransformerHandler.
Source code fixed in both branches, using a very similar
patch to the one above, but in HTMLEmitter. Tested using a
modified version of TraxExamples (on 7.x only)


Attached File

No Files Currently Attached

Changes ( 4 )

Field Old Value Date By
status_id Open 2003-08-14 14:21 mhkay
resolution_id None 2003-08-14 14:21 mhkay
close_date - 2003-08-14 14:21 mhkay
artifact_group_id v7.1 2002-07-25 16:25 mhkay