You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "David Marston (JIRA)" <xa...@xml.apache.org> on 2005/05/18 21:44:49 UTC
[jira] Created: (XALANJ-2120) HTML serialization of empty/unclosed tags should not be affected by content
HTML serialization of empty/unclosed tags should not be affected by content
---------------------------------------------------------------------------
Key: XALANJ-2120
URL: http://issues.apache.org/jira/browse/XALANJ-2120
Project: XalanJ2
Type: Bug
Components: Serialization
Reporter: David Marston
We don't (yet) have a test case, but I observed that when the source document has:
<a><BR>text INSIDE a br</BR></a>
then an <xsl:copy-of select="a"/> should produce:
<a><BR>text INSIDE a br</a>
but XalanJ drops the <BR> entirely, at least in the copy-of case. Suggested rules of thumb:
1. Self-closing <BR/> becomes <BR>, which we already do
2. Starting <BR> becomes <BR>
3. Ending </BR> becomes nothing
and of course, likewise for the other tags listed in part 16.2 of the XSLT 1.0 spec. Notice that rules 2 and 3 work whether or not there is content between the <BR> and </BR>.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org
[jira] Commented: (XALANJ-2120) HTML serialization of empty/unclosed tags should not be affected by content
Posted by "Brian Minchau (JIRA)" <xa...@xml.apache.org>.
[ http://issues.apache.org/jira/browse/XALANJ-2120?page=comments#action_12319044 ]
Brian Minchau commented on XALANJ-2120:
---------------------------------------
Dave,
the W3C has made its ruling on this issue, and we are consistent with that decision, please close this issue (or ..?).
Thanks.
> HTML serialization of empty/unclosed tags should not be affected by content
> ---------------------------------------------------------------------------
>
> Key: XALANJ-2120
> URL: http://issues.apache.org/jira/browse/XALANJ-2120
> Project: XalanJ2
> Type: Bug
> Components: Serialization
> Versions: Latest Development Code
> Reporter: David Marston
> Assignee: Joanne Tong
>
> We don't (yet) have a test case, but I observed that when the source document has:
> <a><BR>text INSIDE a br</BR></a>
> then an <xsl:copy-of select="a"/> should produce:
> <a><BR>text INSIDE a br</a>
> but XalanJ drops the <BR> entirely, at least in the copy-of case. Suggested rules of thumb:
> 1. Self-closing <BR/> becomes <BR>, which we already do
> 2. Starting <BR> becomes <BR>
> 3. Ending </BR> becomes nothing
> and of course, likewise for the other tags listed in part 16.2 of the XSLT 1.0 spec. Notice that rules 2 and 3 work whether or not there is content between the <BR> and </BR>.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org
[jira] Assigned: (XALANJ-2120) HTML serialization of empty/unclosed tags should not be affected by content
Posted by "Brian Minchau (JIRA)" <xa...@xml.apache.org>.
[ http://issues.apache.org/jira/browse/XALANJ-2120?page=all ]
Brian Minchau reassigned XALANJ-2120:
-------------------------------------
Assign To: Brian Minchau
> HTML serialization of empty/unclosed tags should not be affected by content
> ---------------------------------------------------------------------------
>
> Key: XALANJ-2120
> URL: http://issues.apache.org/jira/browse/XALANJ-2120
> Project: XalanJ2
> Type: Bug
> Components: Serialization
> Reporter: David Marston
> Assignee: Brian Minchau
>
> We don't (yet) have a test case, but I observed that when the source document has:
> <a><BR>text INSIDE a br</BR></a>
> then an <xsl:copy-of select="a"/> should produce:
> <a><BR>text INSIDE a br</a>
> but XalanJ drops the <BR> entirely, at least in the copy-of case. Suggested rules of thumb:
> 1. Self-closing <BR/> becomes <BR>, which we already do
> 2. Starting <BR> becomes <BR>
> 3. Ending </BR> becomes nothing
> and of course, likewise for the other tags listed in part 16.2 of the XSLT 1.0 spec. Notice that rules 2 and 3 work whether or not there is content between the <BR> and </BR>.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org
[jira] Assigned: (XALANJ-2120) HTML serialization of empty/unclosed tags should not be affected by content
Posted by "Brian Minchau (JIRA)" <xa...@xml.apache.org>.
[ http://issues.apache.org/jira/browse/XALANJ-2120?page=all ]
Brian Minchau reassigned XALANJ-2120:
-------------------------------------
Assign To: Joanne Tong (was: Brian Minchau)
Assigning to Joanne T.
She has agreed to contact W3C for clarification on empty HTML elements with non-empty content.
The issue is that a result tree that looks like this:
<XX>some stuff</XX>
or if the result tree looks like this, which is actually very different:
<XX></XX>some stuff
then Dave is suggesting that both be serialized as:
<XX>some stuff
Where XX is an HTML empty element from the HTML spec. point of view, even though it might, or might not be empty in the result tree. Is that the intent of XSLT 1.0?
It isn't the serializer's responsibility to generate valid HTML
(document root elemenent of <html>, valid element names, valid attribute, valid attribute values ...).
So perhaps <br>some stuff</br> isn't valid in the result tree to begin with, and we are
masking that bug by dropping the closing tag when the element isn't really empty.
> HTML serialization of empty/unclosed tags should not be affected by content
> ---------------------------------------------------------------------------
>
> Key: XALANJ-2120
> URL: http://issues.apache.org/jira/browse/XALANJ-2120
> Project: XalanJ2
> Type: Bug
> Components: Serialization
> Reporter: David Marston
> Assignee: Joanne Tong
>
> We don't (yet) have a test case, but I observed that when the source document has:
> <a><BR>text INSIDE a br</BR></a>
> then an <xsl:copy-of select="a"/> should produce:
> <a><BR>text INSIDE a br</a>
> but XalanJ drops the <BR> entirely, at least in the copy-of case. Suggested rules of thumb:
> 1. Self-closing <BR/> becomes <BR>, which we already do
> 2. Starting <BR> becomes <BR>
> 3. Ending </BR> becomes nothing
> and of course, likewise for the other tags listed in part 16.2 of the XSLT 1.0 spec. Notice that rules 2 and 3 work whether or not there is content between the <BR> and </BR>.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org
[jira] Closed: (XALANJ-2120) HTML serialization of empty/unclosed tags should not be affected by content
Posted by "David Marston (JIRA)" <xa...@xml.apache.org>.
[ http://issues.apache.org/jira/browse/XALANJ-2120?page=all ]
David Marston closed XALANJ-2120:
---------------------------------
Users expect us to generate valid HTML whenever possible. However, if they give us garbage in, I suppose it's okay to put garbage out.
> HTML serialization of empty/unclosed tags should not be affected by content
> ---------------------------------------------------------------------------
>
> Key: XALANJ-2120
> URL: http://issues.apache.org/jira/browse/XALANJ-2120
> Project: XalanJ2
> Type: Bug
> Components: Serialization
> Versions: Latest Development Code
> Reporter: David Marston
> Assignee: Joanne Tong
>
> We don't (yet) have a test case, but I observed that when the source document has:
> <a><BR>text INSIDE a br</BR></a>
> then an <xsl:copy-of select="a"/> should produce:
> <a><BR>text INSIDE a br</a>
> but XalanJ drops the <BR> entirely, at least in the copy-of case. Suggested rules of thumb:
> 1. Self-closing <BR/> becomes <BR>, which we already do
> 2. Starting <BR> becomes <BR>
> 3. Ending </BR> becomes nothing
> and of course, likewise for the other tags listed in part 16.2 of the XSLT 1.0 spec. Notice that rules 2 and 3 work whether or not there is content between the <BR> and </BR>.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org
[jira] Resolved: (XALANJ-2120) HTML serialization of empty/unclosed tags should not be affected by content
Posted by "Brian Minchau (JIRA)" <xa...@xml.apache.org>.
[ http://issues.apache.org/jira/browse/XALANJ-2120?page=all ]
Brian Minchau resolved XALANJ-2120:
-----------------------------------
Resolution: Invalid
Resolving as invalid. The W3C work group responded to this issue
(contact Joanne Tong on this)
W3C responded that if the SAX events are:
start element BR
end element BR
text "hello"
Then the serialized output should be:
<BR>hello
But if the SAX events are
start BR
text "hello"
end BR
then the output should be
<BR>hello</BR>
Resolving this issue as invalid.
> HTML serialization of empty/unclosed tags should not be affected by content
> ---------------------------------------------------------------------------
>
> Key: XALANJ-2120
> URL: http://issues.apache.org/jira/browse/XALANJ-2120
> Project: XalanJ2
> Type: Bug
> Components: Serialization
> Versions: Latest Development Code
> Reporter: David Marston
> Assignee: Joanne Tong
>
> We don't (yet) have a test case, but I observed that when the source document has:
> <a><BR>text INSIDE a br</BR></a>
> then an <xsl:copy-of select="a"/> should produce:
> <a><BR>text INSIDE a br</a>
> but XalanJ drops the <BR> entirely, at least in the copy-of case. Suggested rules of thumb:
> 1. Self-closing <BR/> becomes <BR>, which we already do
> 2. Starting <BR> becomes <BR>
> 3. Ending </BR> becomes nothing
> and of course, likewise for the other tags listed in part 16.2 of the XSLT 1.0 spec. Notice that rules 2 and 3 work whether or not there is content between the <BR> and </BR>.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org
[jira] Commented: (XALANJ-2120) HTML serialization of empty/unclosed tags should not be affected by content
Posted by "Brian Minchau (JIRA)" <xa...@xml.apache.org>.
[ http://issues.apache.org/jira/browse/XALANJ-2120?page=comments#action_12312992 ]
Brian Minchau commented on XALANJ-2120:
---------------------------------------
Dave, I tried to produce the issue about the dropped <BR> tag.
Here is the stylesheet I used:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" />
<xsl:template match="/"><xsl:copy-of select="a"/></xsl:template>
</xsl:stylesheet>
Here is the intput XML I used:
<?xml version="1.0"?><a><BR>stuff</BR></a>
Here is the output I got:
<a>
<BR>stuff</BR>
</a>
I don't see the bug you reported. Please provide a full testcase on this lost tag.
> HTML serialization of empty/unclosed tags should not be affected by content
> ---------------------------------------------------------------------------
>
> Key: XALANJ-2120
> URL: http://issues.apache.org/jira/browse/XALANJ-2120
> Project: XalanJ2
> Type: Bug
> Components: Serialization
> Reporter: David Marston
> Assignee: Joanne Tong
>
> We don't (yet) have a test case, but I observed that when the source document has:
> <a><BR>text INSIDE a br</BR></a>
> then an <xsl:copy-of select="a"/> should produce:
> <a><BR>text INSIDE a br</a>
> but XalanJ drops the <BR> entirely, at least in the copy-of case. Suggested rules of thumb:
> 1. Self-closing <BR/> becomes <BR>, which we already do
> 2. Starting <BR> becomes <BR>
> 3. Ending </BR> becomes nothing
> and of course, likewise for the other tags listed in part 16.2 of the XSLT 1.0 spec. Notice that rules 2 and 3 work whether or not there is content between the <BR> and </BR>.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org
[jira] Updated: (XALANJ-2120) HTML serialization of empty/unclosed tags should not be affected by content
Posted by "Brian Minchau (JIRA)" <xa...@xml.apache.org>.
[ http://issues.apache.org/jira/browse/XALANJ-2120?page=all ]
Brian Minchau updated XALANJ-2120:
----------------------------------
Environment:
Description:
We don't (yet) have a test case, but I observed that when the source document has:
<a><BR>text INSIDE a br</BR></a>
then an <xsl:copy-of select="a"/> should produce:
<a><BR>text INSIDE a br</a>
but XalanJ drops the <BR> entirely, at least in the copy-of case. Suggested rules of thumb:
1. Self-closing <BR/> becomes <BR>, which we already do
2. Starting <BR> becomes <BR>
3. Ending </BR> becomes nothing
and of course, likewise for the other tags listed in part 16.2 of the XSLT 1.0 spec. Notice that rules 2 and 3 work whether or not there is content between the <BR> and </BR>.
was:
We don't (yet) have a test case, but I observed that when the source document has:
<a><BR>text INSIDE a br</BR></a>
then an <xsl:copy-of select="a"/> should produce:
<a><BR>text INSIDE a br</a>
but XalanJ drops the <BR> entirely, at least in the copy-of case. Suggested rules of thumb:
1. Self-closing <BR/> becomes <BR>, which we already do
2. Starting <BR> becomes <BR>
3. Ending </BR> becomes nothing
and of course, likewise for the other tags listed in part 16.2 of the XSLT 1.0 spec. Notice that rules 2 and 3 work whether or not there is content between the <BR> and </BR>.
fix-priority: fp4
Set to fp4 due to JIRA meeting on June 7.
> HTML serialization of empty/unclosed tags should not be affected by content
> ---------------------------------------------------------------------------
>
> Key: XALANJ-2120
> URL: http://issues.apache.org/jira/browse/XALANJ-2120
> Project: XalanJ2
> Type: Bug
> Components: Serialization
> Reporter: David Marston
> Assignee: Joanne Tong
>
> We don't (yet) have a test case, but I observed that when the source document has:
> <a><BR>text INSIDE a br</BR></a>
> then an <xsl:copy-of select="a"/> should produce:
> <a><BR>text INSIDE a br</a>
> but XalanJ drops the <BR> entirely, at least in the copy-of case. Suggested rules of thumb:
> 1. Self-closing <BR/> becomes <BR>, which we already do
> 2. Starting <BR> becomes <BR>
> 3. Ending </BR> becomes nothing
> and of course, likewise for the other tags listed in part 16.2 of the XSLT 1.0 spec. Notice that rules 2 and 3 work whether or not there is content between the <BR> and </BR>.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org
[jira] Commented: (XALANJ-2120) HTML serialization of empty/unclosed tags should not be affected by content
Posted by "Brian Minchau (JIRA)" <xa...@xml.apache.org>.
[ http://issues.apache.org/jira/browse/XALANJ-2120?page=comments#action_12312983 ]
Brian Minchau commented on XALANJ-2120:
---------------------------------------
The bug reported here is that the xsl:copy has dropped the <BR> entirely.
The XSLT 1.0 recommendation ( http://www.w3.org/TR/xslt ) says this in section 16.2 on the HTML output method:
<<
The html output method should not output an end-tag for empty elements. For HTML 4.0, the empty elements are area, base, basefont, br, col, frame, hr, img, input, isindex, link, meta and param. For example, an element written as <br/> or <br></br> in the stylesheet should be output as <br>.
>>
This seems pretty clear to me.
Dave, is there another problem here? Do you have a testcase where the serialization of an empty element, like <BR> is written out as:
<BR>some text</BR>
or as:
<BR/>
?
This might be OK, because the BR element might not be HTML because it is in a non-null namespace URI, and we must treat it as XML.
namespace, then it is HTML, section 16.2 also says this:
<<
The html output method should not output an element differently from the xml output method unless the expanded-name of the element has a null namespace URI; an element whose expanded-name has a non-null namespace URI should be output as XML.
>>
Testcase showing the <BR/> or </BR> issue please.
> HTML serialization of empty/unclosed tags should not be affected by content
> ---------------------------------------------------------------------------
>
> Key: XALANJ-2120
> URL: http://issues.apache.org/jira/browse/XALANJ-2120
> Project: XalanJ2
> Type: Bug
> Components: Serialization
> Reporter: David Marston
>
> We don't (yet) have a test case, but I observed that when the source document has:
> <a><BR>text INSIDE a br</BR></a>
> then an <xsl:copy-of select="a"/> should produce:
> <a><BR>text INSIDE a br</a>
> but XalanJ drops the <BR> entirely, at least in the copy-of case. Suggested rules of thumb:
> 1. Self-closing <BR/> becomes <BR>, which we already do
> 2. Starting <BR> becomes <BR>
> 3. Ending </BR> becomes nothing
> and of course, likewise for the other tags listed in part 16.2 of the XSLT 1.0 spec. Notice that rules 2 and 3 work whether or not there is content between the <BR> and </BR>.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org