[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: XSL transformation removing closing tag for empty

Subject: Re: XSL transformation removing closing tag for empty div
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Sun, 03 Jun 2007 15:19:20 +0200
Re:  XSL transformation removing closing tag for empty
Michael Kay wrote:
Presumably if the recipient can't handle an empty element tag that means
it's expecting HTML rather than XML, so use <xsl:output method="html">.

The OP is using an AJAX call. AJAX usually means that XMLHttpRequest is used to receive XML from a server. It is possible to use the text content of the response, in which case HTML would suffice. But if the OP uses the returned XML as DOM object, the DOM object will be empty or null when the the output method on the server is set to HTML.

And if the OP is indeed using the DOM, (s)he can use the DOM to manipulate the result. I use AJAX daily and never have any problem with minimized tags, because I use the DOM directly and add the DOM to the HTML DOM of the page (in which case it doesn't matter at all how the element would be serialized).

I am guessing here: if the OP is using, for some reason, the serialized version of the response object of XMLHttpRequest, and tries to insert that with innerHTML for example, it might give well-known rendering problems to have certain tags in minimized form. A workaround is to add some content into the DIV, since the content is going to be replaced anyway. I.e.:

<div><!-- some comment node --></div>

-- Abel Braaksma

Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.