Re: meta tags in XHTML 1.0 validation

Christopher G D Tipper wrote:

>recently my pages have stopped validating. I use XSLT to generate meta tags, for example
>
>    <xsl:element name="meta">
>         <xsl:attribute name="name">author</xsl:attribute>
>         <xsl:attribute name="content">
>             <xsl:call-template name="authorname"/>
>         </xsl:attribute>
>     </xsl:element>
>
>This produces <meta name=".." content=".."></meta> This is now flagged as not XHTML 1.0 compliant.
>
>I have no control over the XSLT processors interpretation. Isn't the validator technically wrong to discriminate tags on this basis?
>  
>


I'm interested as to which XSLT processor you're using.  I've been using 
Apache Xalan and it has similar but different quirks.  For example, it 
minimises where possible, e.g. <meta ...></meta> is minimised to <meta 
.../>.  This is a slight problem with Javascript elements because 
<script src="..."></script> is minimised to <script src="..."/>.  This 
exposes bugs in Internet Explorer and Mozilla, where the script elements 
are ignored if they are minimised.  The browsers are behaving wrongly, 
but that's the way they are. 

My workaround is this:
<script type="text/javascript" src="..."><![CDATA[/* workaround 
*/]]></script>
which Xalan does not minimise.

My other bugbear with Xalan is that sometimes it puts default attribute 
values in for you.  Notably, <br/> is emitted as <br clear="none" />
I don't know how to suppress this behaviour.  It means I can't use Xalan 
to generate XHTML 1.1, although XHTML 1.0 Strict is ok.  (the clear 
attribute is not present on <br/> in XHTML 1.1).  [This is a shame - I 
like the leanness of XHTML 1.1  :-) ]

Is this a bug in Xalan?
What do other XSLT processors do?

Rick :-)


-- 
Registered Office: Roke Manor Research Ltd, Siemens House, Oldbury, Bracknell,
Berkshire. RG12 8FZ

The information contained in this e-mail and any attachments is confidential to
Roke Manor Research Ltd and must not be passed to any third party without
permission. This communication is for information only and shall not create or
change any contractual relationship.

Received on Monday, 9 February 2004 05:59:09 UTC