You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "Brian Minchau (JIRA)" <xa...@xml.apache.org> on 2005/06/08 05:25:42 UTC

[jira] Commented: (XALANJ-2120) HTML serialization of empty/unclosed tags should not be affected by content

    [ 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