My previous problem where the XSLT processor was outputting an unclosed meta tag has been solved. The W3C XSLT spec specifies that the processor should not output a new meta tag if there is one already present. Thus the way to fix the output so it did not add a meta tag was to insert one myself. However there are a few things to note. It will only do it within an html element that has the xhtml namespace. Also, if you do not have a trailing space before the closing / it will not work. See my example below (note I tried to use include-content-type=”no” which may or may not have worked. It takes a while to recompile and deploy the service-unit so I haven’t tried it):


<xsl:output method="xhtml" include-content-type="no"/>
<xsl:template match="result">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-JP" />
...

  2 Responses to “XSLT META Tag Output”

  1. Hi Jamie, sorry about responding to this old post, but playing with XSLT and this came up in my problem search. I am attempting to prevent phone number linking in a document. As I understand things, the following is the Safari approved way to do it. Replacing tags with [ ] to avoid comment issues:

    [meta name="format-detection"content="telephone=no" /]

    I added the XHTML namespace as you mentioned above, but still get an unclosed tag problem. I was wondering if the “http-equiv” was required, or is that the meta you were trying to add in the first place?

    I still need to play with it. XSLT is a rather murky business when you are a noob like me :-) If you are interested, the page I was working on is an old AD&D monster listing, here: http://adventuresinnerdliness.net/dnd/adnd/monsters/devils.xml

    Regards, Darius

  2. Hey Darius,

    Sorry I took so long to reply, I’ve been neglecting my blog a bit these last few weeks (my spam queue is MASSIVE).

    From what I remember, I needed to add the XHTML namespace as well as the http-equiv meta tag in order to stop it making it’s own one. I think the XSLT engine wants to add an http-equiv meta, but it won’t if you have created one yourself.

    Hope this helps.

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">

   
© 2011 Jamie's Space Suffusion theme by Sayontan Sinha