XSLT: Missing Closing / Self Closing Tags (img, br,…)

If you are using XSLT to transform XML documents into HTML for display within a website and you have found that your ,
and other regularly self-closing tags are not being closed in the transform output its a good chance you need to take a look at the output method being used by the XSLT.
The output method of the XSLT determines just how strictly the output will follow the XML standard. Add the following to your XSLT:

<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" omit-xml-declaration="no"/>

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s