Hi,

I use the XHTML output method and to me it seems that tags with a non-empty
content model (like <p/>) are serialized incorrectly, when they are empty.

Example:
xquery version "1.0-ml";
xdmp:xslt-eval(
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
version="2.0">
      <xsl:output method="xhtml" media-type="text/html" encoding="utf-8"
omit-xml-declaration="yes" indent="no"/>
      <xsl:template match="root">
          <p/>
      </xsl:template>
  </xsl:stylesheet>
  ,
  <root></root>
)
==> Result: <p/>
Expected result: <p></p>

In the specification for the XHTML output method [1] the following is
defined:
Given an empty instance of an XHTML element whose content model is not
EMPTY (for example, an empty title or paragraph) the serializer *MUST NOT*
use the minimized form. That is, it *MUST* output <p></p> and not <p />.

Cheers,
Andreas

[1] https://www.w3.org/TR/xslt-xquery-serialization/#xhtml-output
_______________________________________________
General mailing list
[email protected]
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to