Edgewall Software

Opened 17 years ago

Closed 17 years ago

#156 closed defect (fixed)

<?xml ?> declaration is misplaced using Stream.render('xml', doctype='xhtml')

Reported by: bigcheesegs@… Owned by: athomas
Priority: minor Milestone: 0.5
Component: Serialization Version:
Keywords: xml doctype Cc:

Description

According to the XML 1.0 spec section 4.3.1 (http://www.w3.org/TR/xml/#sec-TextDecl)

The text declaration MUST NOT appear at any position other than the beginning of an external parsed entity.

However, using Stream.render('xml', doctype='xhtml'), the output contains.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<?xml version="1.0" encoding="utf-8"?>
... rest of document ...

Which is not well-formed XML.

Attachments (1)

genshi-doctype.diff (3.5 KB) - added by athomas 17 years ago.
Updated to work with other serialisers.

Download all attachments as: .zip

Change History (5)

comment:1 Changed 17 years ago by cmlenz

  • Milestone set to 0.5

comment:2 Changed 17 years ago by athomas

  • Owner changed from cmlenz to athomas

comment:3 Changed 17 years ago by athomas

Please try this patch. WFM, but YMMV.

Changed 17 years ago by athomas

Updated to work with other serialisers.

comment:4 Changed 17 years ago by athomas

  • Resolution set to fixed
  • Status changed from new to closed

Applied in r787.

Note: See TracTickets for help on using tickets.