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"/>

Published by

Unknown's avatar

Tim Clark

Experienced Business Owner, Chief Information Officer, Vice President, Chief Software Architect, Application Architect, Project Manager, Software Developer, Senior Web Developer, Graphic Designer & 3D Modeler, University Instructor, University Program Chair, Academic Director. Specialties: Ruby, Ruby on Rails, JavaScript, JQuery, AJAX, Node.js, React.js, Angular.js, MySQL, PostgreSQL, MongoDB, SQL Server, Responsive Design, HTML5, XHTML, CSS3, C#, ASP.net, Project Management, System Design/Architecture, Web Design, Web Development, Adobe CS6 (Photoshop, Illustrator)

Leave a comment