xsl-list
[Top] [All Lists]

Re: <empty /> vs <empty></empty?

2005-12-11 13:33:51
On 12/12/05 2:44 AM, "drkm" <darkman_spam(_at_)yahoo(_dot_)fr> wrote:

Is there any way to control whether empty elements appear as
<empty></empty>, instead of <empty/>?

My problem is that some browsers don't like <div/> or
<a name="x"/>,

Browser?  So you use 'xhtml' or 'html' serialization method, don't
you?  

yes.

<xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"
    doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";
    doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" />


If it's the case, you must don't get any element serialized as
"<empty/>" (but as "<empty></empty>" or "<empty>").

See <URL:http://www.w3.org/TR/xslt-xquery-serialization/>.

More exactly: http://www.w3.org/TR/xslt-xquery-serialization/#xhtml-output

    [Definition: The following XHTML elements have an EMPTY content model:
    area, base, br, col, hr, img, input, link, meta, basefont, frame,
    isindex, and param.] Given an empty instance of an XHTML element whose
    content model is not EMPTY (for example, an empty title or paragraph)
    the serializer MUST NOT use the minimized form. That is, it MUST output
    <p></p> and not <p />.

So, it would seem the serialiser I'm using is defective, yes? Sadly, I don't
think I have a choice in the matter, since I'm using the built in XSLT
functionality of Filemaker.

e.


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