xsl-list
[Top] [All Lists]

RE: how to close html tags : link, meta,...

2003-08-13 02:36:46
From: owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
[mailto:owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com]On Behalf Of 
Andrew Welch
Sent: Wednesday, August 13, 2003 10:30 AM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: RE: [xsl] how to close html tags : link, meta,...



hi,
i'm using xslt to transform an xml file into a html file
my problem is that i really need to have the empty tags( meta, link,
img,...) closed and I don't know how to do this...

In which case you shouldn't transform to HTML. Use the "xml" output
method:

<xsl:output method="xml" />

You will discover that using the xml output method will solve this
particular issue, but cause you no end of html style issues, such as:

<div style="background:blue">
  <div/>
</div>

Will make everything after the outer <div> have a blue background.  Of
course this is perfectly legal xml, and to any xml aware receiving
application <div/> and <div></div> are identical - but not to IE.  IE
will treat the empty element <div/> as an opening tag, the following
</div> as its closing tag, and then everything that follows as children
of the outer <div style="background:blue">.
...

This just means that it doesn't make sense to send XHTML to IE, because it
doesn't support it. Where's the news here?

Julian

--
<green/>bytes GmbH -- http://www.greenbytes.de -- tel:+492512807760


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list