Welcome to MSDN Blogs Sign in | Join | Help

Unwanted Meta tag after xlst processing.

I have an xslt that I use to generate a nice HTML representation of Visual Studio unit test result file (.trx), Last week, I discovered a problem, that the generated HTML includes an unwanted META tag. I did not have meta tag in the xslt, and it is bad because the meta tag does not have a closing tag, the generated html is a malformed xml. This makes post-processing little bit dificult.

It looks like this, notice how the META tag was not closed:

  <HEAD>
    <META http-equiv="Content-Type" content="text/html; charset=utf-8">
    <TITLE></TITLE>
  </HEAD>

After searching, I discovered the <xsl:output> element. Adding this element to the xslt, makes the html xml-compliant.

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

After adding the xsl:output element to the xslt, the meta tag is gone.

Published Monday, March 19, 2007 7:08 PM by HelloWorld
Filed under: ,

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

No Comments

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
 
Page view tracker