The <br> element is not considered to be an "XHTML element" unless it is in the XHTML namespace. In your case it is in no namespace.

Michael Kay
+44 (0118) 946 5893

On 8 Jul 2014, at 11:23, Christian Schwaderer <> wrote:

Hi all,

I'm a little bit confused about what Saxon 9.5.13 does with empty tags (<br/>) if I set <xsl:output method="xhtml"/>

The specifications say:
"If an element that has no children is an XHTML element with an EMPTY content model, the serializer MUST use the minimized tag syntax, for example <br />, as the alternative syntax <br></br> allowed by XML gives uncertain results in many existing user agents."

But given this XSLT file

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl=""
    <xsl:output method="xhtml"/>
    <xsl:template match="/">
                Line 1<br/>Line 2

Saxon gives me

<?xml version="1.0" encoding="UTF-8"?><html>
      Line 1
      Line 2

and that is indeed causing problems, because <br></br> is interpreted as TWO line breaks by Browsers. Is this a bug/wrong specification implementation of Saxon?

Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
saxon-help mailing list archived at