<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	>
<channel>
	<title>Comments on: Make empty elements with XSLT</title>
	<atom:link href="http://chafic.com/2004/04/14/make-empty-elements-with-xslt/feed/" rel="self" type="application/rss+xml" />
	<link>http://chafic.com/2004/04/14/make-empty-elements-with-xslt/</link>
	<description>Technical discussion of Flex, Flash, and RIA development</description>
	<pubDate>Thu, 29 Jul 2010 17:46:50 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Bob</title>
		<link>http://chafic.com/2004/04/14/make-empty-elements-with-xslt/comment-page-1/#comment-241758</link>
		<dc:creator>Bob</dc:creator>
		<pubDate>Sun, 06 Apr 2008 18:02:47 +0000</pubDate>
		<guid isPermaLink="false">http://rewindlife.com/?p=155#comment-241758</guid>
		<description>It's been a while since this thread was added to (by anything other than spambots), but I'll add that I was having the same problem.

Empty elements with attributes were being given a closing tag, rather than the compact single, closed tag.

In the end, adding the following attribute to the xsl:stylesheet element worked for me,

    xmlns="http://www.w3.org/1999/xhtml"

This, in conjunction with an xsl:output element with method="xhtml", produces single, closed tags with a space before the forward slash (because of compatibility problems that some old browsers have), which is exactly as I need it.

I'm using Saxon-9b, by the way.</description>
		<content:encoded><![CDATA[<p>It&#8217;s been a while since this thread was added to (by anything other than spambots), but I&#8217;ll add that I was having the same problem.</p>
<p>Empty elements with attributes were being given a closing tag, rather than the compact single, closed tag.</p>
<p>In the end, adding the following attribute to the xsl:stylesheet element worked for me,</p>
<p>    xmlns=&#8221;http://www.w3.org/1999/xhtml&#8221;</p>
<p>This, in conjunction with an xsl:output element with method=&#8221;xhtml&#8221;, produces single, closed tags with a space before the forward slash (because of compatibility problems that some old browsers have), which is exactly as I need it.</p>
<p>I&#8217;m using Saxon-9b, by the way.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sam</title>
		<link>http://chafic.com/2004/04/14/make-empty-elements-with-xslt/comment-page-1/#comment-614</link>
		<dc:creator>Sam</dc:creator>
		<pubDate>Wed, 14 Apr 2004 16:11:21 +0000</pubDate>
		<guid isPermaLink="false">http://rewindlife.com/?p=155#comment-614</guid>
		<description>Yup, have the output tag in there, it still creates opening and closing tags.  I think it has to do with the fact that I am creating elements with &lt;xsl:element&gt; which requires opening and closing tags in the XSLT in order to create dynamic attributes--it must contain the &lt;xsl:attribute&gt; tag.</description>
		<content:encoded><![CDATA[<p>Yup, have the output tag in there, it still creates opening and closing tags.  I think it has to do with the fact that I am creating elements with &lt;xsl:element&gt; which requires opening and closing tags in the XSLT in order to create dynamic attributes&#8211;it must contain the &lt;xsl:attribute&gt; tag.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Webster</title>
		<link>http://chafic.com/2004/04/14/make-empty-elements-with-xslt/comment-page-1/#comment-613</link>
		<dc:creator>Steve Webster</dc:creator>
		<pubDate>Wed, 14 Apr 2004 11:50:03 +0000</pubDate>
		<guid isPermaLink="false">http://rewindlife.com/?p=155#comment-613</guid>
		<description>Hey Sam,

Okay, so your commenting system doesn't like &lt; and &gt; Let's try again...

Add an &lt;xsl:output /&gt; element with its 'method' attribute set to 'xml', as a child of your main stylesheet element...

&lt;xsl:stylesheet version="1.0" ...&gt;
  &lt;xsl:output method="xml" /&gt;
  ...
&lt;/xsl:stylesheet&gt;

That should do it for you without having to resort to creating your empty elements as text.</description>
		<content:encoded><![CDATA[<p>Hey Sam,</p>
<p>Okay, so your commenting system doesn&#8217;t like &lt; and &gt; Let&#8217;s try again&#8230;</p>
<p>Add an &lt;xsl:output /&gt; element with its &#8216;method&#8217; attribute set to &#8216;xml&#8217;, as a child of your main stylesheet element&#8230;</p>
<p>&lt;xsl:stylesheet version=&#8221;1.0&#8243; &#8230;&gt;<br />
  &lt;xsl:output method=&#8221;xml&#8221; /&gt;<br />
  &#8230;<br />
&lt;/xsl:stylesheet&gt;</p>
<p>That should do it for you without having to resort to creating your empty elements as text.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Webster</title>
		<link>http://chafic.com/2004/04/14/make-empty-elements-with-xslt/comment-page-1/#comment-612</link>
		<dc:creator>Steve Webster</dc:creator>
		<pubDate>Wed, 14 Apr 2004 11:46:18 +0000</pubDate>
		<guid isPermaLink="false">http://rewindlife.com/?p=155#comment-612</guid>
		<description>Hey Sam,

Add an  element with its 'method' attribute set to 'xml', as a child of your main stylesheet element...


  
  ...


That should do it for you without having to resort to creating your empty elements as text.</description>
		<content:encoded><![CDATA[<p>Hey Sam,</p>
<p>Add an  element with its &#8216;method&#8217; attribute set to &#8216;xml&#8217;, as a child of your main stylesheet element&#8230;</p>
<p>  &#8230;</p>
<p>That should do it for you without having to resort to creating your empty elements as text.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve Webster</title>
		<link>http://chafic.com/2004/04/14/make-empty-elements-with-xslt/comment-page-1/#comment-611</link>
		<dc:creator>Steve Webster</dc:creator>
		<pubDate>Wed, 14 Apr 2004 11:43:49 +0000</pubDate>
		<guid isPermaLink="false">http://rewindlife.com/?p=155#comment-611</guid>
		<description>Hey Sam,

Add an  element with its 'method' attribute set to 'xml', as a child of your main stylesheet element...


  
  ...


That should do it for you!</description>
		<content:encoded><![CDATA[<p>Hey Sam,</p>
<p>Add an  element with its &#8216;method&#8217; attribute set to &#8216;xml&#8217;, as a child of your main stylesheet element&#8230;</p>
<p>  &#8230;</p>
<p>That should do it for you!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
