XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Lee HumphriesSubject: Really annoying stuff-up in XSLT processors
Author: Lee Humphries
Date: 25 Feb 2003 07:58 PM
I've been cleaning up several of my XSLTs that produce our internal documentation to make them XHTML1.1 compliant.
Just one problem with that The Stylus XSLT processor, Xalan, .NET and Saxon all insist on screwing things up. Here's what happens

I have a Stylesheet that opens like this:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" omit-xml-declaration="yes" encoding="UTF-8" indent="yes" doctype-public="-//W3C//DTD XHTML 1.1//EN" doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"/>

<xsl:template match="/">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><xsl:value-of select="Index/Title"/></title>
<link rel="stylesheet" href="wcIntDoc.css" type="text/css"/>
</head>
...
So it's pretty plain that I want an html document that's XHTML 1.1

However all of the above processors give me this:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Documentation</title>
<link rel="stylesheet" href="wcIntDoc.css" type="text/css">
</head>

The DOCTYPE delcaration is right, but notice that an old-style open META tag has been dropped in and the link tag has been needlessly opened up. If I happen to have other meta tags they get opened up as well.
None of these additions and changes are XHTML compliant.

At the moment I have to specify the output method as xml and supply my own meta tag or just stick to using MSXML 3/4

Postnext
Minollo I.Subject: Re: Really annoying stuff-up in XSLT processors
Author: Minollo I.
Date: 25 Feb 2003 08:13 PM
From the XSLT 1.0 specs, in the HTML Output Method section:

"...
The html output method should not output an end-tag for empty elements. For
HTML 4.0, the empty elements are area, base, basefont, br, col, frame, hr,
img, input, isindex, link, meta and param. For example, an element written
as {br/} or {br}{/br} in the stylesheet should be output as {br}.
..../
If there is a HEAD element, then the html output method should add a META
element immediately after the start-tag of the HEAD element specifying the
character encoding actually used. For example,

{HEAD}
{META http-equiv="Content-Type" content="text/html; charset=EUC-JP"}
....
"

So, you do have to choose the XML output method if you want to create XHTML.
In XSLT 2.0 you will be able to choose XHTML as the output method, and that
will make your life easier.

Minollo

Posttop
Shane McRobertsSubject: Really annoying stuff-up in XSLT processors
Author: Shane McRoberts
Date: 28 Sep 2005 12:58 AM
Originally Posted: 28 Sep 2005 12:57 AM
And strangely enough this is still true two years later in XSLT 2.0, even for output method xhtml. I don't see how that makes sense. It's not even well formed xml.

 
Topic Page 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.