Project

Profile

Help

XHTML META tag letter case

Added by Anonymous almost 16 years ago

Legacy ID: #5246782 Legacy Poster: sh (sh_9109394)

Hello, I use a XSLT script to generate XHTML files. I use <xsl:output method="xhtml" indent="no" encoding="utf-8" include-content-type="no" media-type="text/html" omit-xml-declaration="no" escape-uri-attributes="no"/> to define output format and character encoding. Saxon generates the XML declaration <?xml version="1.0" encoding="utf-8"?> and the meta tag <META http-equiv="Content-Type" content="text/html; charset=utf-8" /> That's OK so far. But the XHTML validation complains about the character case of the word "META". Is there a way to take influence on this tag, to write it with small characters? Regards Stefan


Replies (6)

Please register to reply

RE: XHTML META tag letter case - Added by Anonymous almost 16 years ago

Legacy ID: #5246881 Legacy Poster: Michael Kay (mhkay)

Strange. What Saxon release are you using? Please add <xsl:comment>Generated by <xsl:value-of select="system-property('xsl:product-version')"/></xsl:comment> to the stylesheet, just to make sure you are using what you think you are using.

RE: XHTML META tag letter case - Added by Anonymous almost 16 years ago

Legacy ID: #5247369 Legacy Poster: sh (sh_9109394)

I'm very sorry. That was my fault. I use saxon 9.1.0.2j. Because of the meta tag about the charset isn't generated in "xhtml" output I inserted it manually (with capital letters). Is it possible to activate this feature for XHTML output? Stefan

RE: XHTML META tag letter case - Added by Anonymous almost 16 years ago

Legacy ID: #5247423 Legacy Poster: Willem van Heerde (wheerde)

Hello Stefan, Correct xhtml only uses lowercase tag names. The meta element should be written in lowercase. Willem.

RE: XHTML META tag letter case - Added by Anonymous almost 16 years ago

Legacy ID: #5247430 Legacy Poster: Michael Kay (mhkay)

Provided your result tree contains a <head> element in the XHTML namespace, Saxon should automatically generate a <meta> element as a child. Unless of course you suppress it using include-content-type="no".

RE: XHTML META tag letter case - Added by Anonymous almost 16 years ago

Legacy ID: #5252760 Legacy Poster: sh (sh_9109394)

>Provided your result tree contains a <head> element in the XHTML namespace That's right. If I declare <xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml"> in the XSLT script the meta tag is generated. This was the thing I missed. I thought it would be enough to switch the content of <xsl:output method = "html" > to <xsl:output method = "xhtml" > so that the output document is handled as XHTML document. So I have to do two changes to switch to XHTML output. I have one other question not sure if it's worth a new thread. I use <xsl:include> elements to assemble several files to one script. But why the namespace declaration aren't inherited from the "root" script? An example: In the root script I define a default namespace <xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml"> When I include a template to create e.g. the header, saxon adds an empty namespace declaration, like <head xmlns=""> (and of course not in XHTML namespace) So my question: Is XSLT include intentional different frim xi:include? Stefan

RE: XHTML META tag letter case - Added by Anonymous almost 16 years ago

Legacy ID: #5252823 Legacy Poster: Michael Kay (mhkay)

>I use <xsl:include> elements to assemble several files to one script. But why the namespace declaration aren't inherited from the "root" script? That's a general XSLT question, nothing specific to Saxon. It should probably go on xsl-list at mulberrytech.com. But the answer is that xsl:include works at the level of the tree model, not at the lexical XML level. Namespaces are attached to elements by the XML parser, not by the XSLT processor, and the XML parser doesn't know anything about xsl:include. I think that the same thing is true for xi:include, by the way - an included document can't have an element called <foo:bar> unless it declares namespace foo itself; it can't rely on the "calling" document declaring it. But I'm no expert on XInclude.

    (1-6/6)

    Please register to reply