xsl-list
[Top] [All Lists]

Re: Preventing tags from collapsing

2005-04-15 02:23:30
As mentioned before, not just IE. FYI, we also have big problems with <textarea> and mozilla, for instance.

Ta,
B

Andrew Welch wrote:

In our case it turns out that it is XML transforms happening long before XSL comes on the scene that are causing the minimisation.

Although, I suppose we could then use XSL to find nodes with no content, and then 'un-minimise' them by inserting some comments text. Hmm.. it's worth a go I suppose.

Yes - the part you are concerned with here is the way that the result
tree (the result of the transformation) gets serialised.  XSLT operates
on a source tree created by the XML parser - XSLT doesn't know whether
in the XML the element was written as <foo/> or <foo></foo>, all it sees
is a node in a tree.  Equally in the result tree a node is just a node,
only when that node gets serialised is there any influence over whether
the node gets written out as <foo/> or <foo></foo>.  XSLT generates the
result tree, the serialiser operates on the result tree to produce the
output.

If you have specified the HTML output method, then the serialiser checks
against a set of rules and will write out HTML elements correctly eg
<meta> with no closing tag as it is defined as EMPTY in the HTML DTD.
If you have specified the XHTML output method of 2.0 then the serialiser
will write out <meta /> as an empty XML element, as that how it defined
in XHTML.  The key to remember here is that in XML <foo/> and
<foo></foo> are identical - it's only when we send XML to the HTML
parser in IE that it becomes significant.
cheers
andrew

--~------------------------------------------------------------------
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>
--~--




--~------------------------------------------------------------------
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>