You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by bu...@apache.org on 2004/07/09 19:32:21 UTC
DO NOT REPLY [Bug 30007] New: -
[xhtml output] Empty element form for non EMPTY declared elements
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=30007>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=30007
[xhtml output] Empty element form for non EMPTY declared elements
Summary: [xhtml output] Empty element form for non EMPTY declared
elements
Product: XalanJ2
Version: 2.0.0
Platform: All
OS/Version: All
Status: NEW
Severity: Minor
Priority: Other
Component: Xalan
AssignedTo: xalan-dev@xml.apache.org
ReportedBy: brbromo@tin.it
- The stylesheet:
> <?xml version="1.0" encoding="UTF-8"?>
>
> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>
> <xsl:output method="xml" version="1.0" encoding="iso-8859-1" indent="yes"
> omit-xml-declaration="no" doctype-public="-//W3C//DTD XHTML 1.0
Strict//EN"
> doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" />
>
> <xsl:template match="/">
> <html>
> <head>
> <title>bug test</title>
> </head>
> <body>
> <div></div>
> </body>
> </html>
> </xsl:template>
>
> </xsl:stylesheet>
- The output:
> <?xml version="1.0" encoding="iso-8859-1"?>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> <html>
> <head>
> <title>bug test</title>
> </head>
> <body>
> <div />
> </body>
> </html>
- The standards:
> Empty-element tags MAY be used for any element which has no content,
> whether or not it is declared using the keyword EMPTY.
> For interoperability, the empty-element tag SHOULD be used, and
> SHOULD only be used, for elements which are declared EMPTY.
(http://www.w3.org/TR/REC-xml/#sec-starttags)
> C.3. Element Minimization and Empty Element Content
> Given an empty instance of an element whose content model
> is not EMPTY (for example, an empty title or paragraph) do
> not use the minimized form (e.g. use <p> </p> and not <p />).
(http://www.w3.org/TR/xhtml1/#guidelines)
- The patch:
Elements like <p> or <div> aren't declared as EMPTY in the XHTML DTD.
According to XML and XHTML standards, the <div></div> form should be used
instead of <div/>. Both are XML (and XHTML) valid, but the second leads to
strange problems with some browsers (guess who --- IE).
Hope this helps,
Marco
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org