xsl-list
[Top] [All Lists]

Re: [xsl] Understanding why <tag></tag> is the way it is (was Re: [xsl] IE Client side transformation issue)

2007-08-03 09:51:48
Maybe I wasn't clear that the examples I mentioned were about XHTML, not about HTML, because the OP was all about XHTML rendering with XSLT 1.0

David Carlisle wrote:
instead of the more sensible <script />,
You say sensible, but in html it's a syntax error.

Not in XHTML. In XHTML you can write:
<script type="text/javascript" src="scripts/myscript.js" />
as well as
<script type="text/javascript" src="scripts/myscript.js" ></script>

but the first will not render well in IE, both will render well in FF and Opera, I don't know about Safari and Konqeror. I assume the correct document type is set (I believe the OP had one set correctly).



(the opposite is also true: <br /> should not be written as <br></br> because, you guessed it right, IE cannot handle it well)

that's a syntax error in HTML as well, so why should IE handle it?
(when acting as an HTML system, which is all it claims to act as).

Same here. XHTML 1.0 allows both <br />, <br/> <br></br> but discourages the second and third because of possible incorrect rendering by engines that were before used to HTML: http://www.w3.org/TR/xhtml1/#h-4.6 and http://www.w3.org/TR/xhtml1/#C_2 (informative)

The opposite is also true, if the content is not defined as EMPTY in the DTD (i.e, like a <p> tag), omitting the end-tag is allowed by the spec, but discouraged by the compatibility guidelines: http://www.w3.org/TR/xhtml1/#C_3 (informative)

this latter is far more a problem when naively creating XHTML with an XSLT 1.0 processor with output method "xml". There is a cdata-section-elements on xsl:output, but not a never-minimize-elements attribute or something similar.

Cheers,
-- Abel Braaksma

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>