[xslt] Re: [xml] xsltproc outputs invalid meta tag for xhtml

Hello Daniel,
it's nice that you show your skill to flame that much.
But my xslt stylesheet does use

<xsl:output method="xml" encoding="iso-8859-1"
doctype-public="-//W3C//DTD XHTML 1.1//EN"
doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"; />

which is AFAIK the correct specification of XHTML1.1, isn't it?
Just as you suggested in your first mail, and claimed i did not read.
Still the output is "<br/>", so i can't really use this for generating
fully html-compatible xhtml.

Attached is an unbelievably complex example...
The result contains "<br/>" thus is unuseable for HTML compatibility.
changing xsl:output/@method to "html" will result in an non-XML file
(due to the meta tag) with the non-standard <br></br> (although <br> has
minimal content model empty, so C.3 of XHTML1.0 doesn't apply)

The result i'd like to get is attached as "test.xhtml". This file is
valid XHTML (AFAICT), while being parseable by any html parser i know of
(using the <br /> version as in C.2 of the XHTML1.0 specs and the closed
meta tag as required for XML).

>From 3.1.1 of XHTML1.0:
"An XML declaration is not required in all XML documents; however XHTML
document authors are strongly encouraged to use XML declarations in all
their documents. Such a declaration is required when the character
encoding of the document is other than the default UTF-8 or UTF-16 and
no encoding was determined by a higher-level protocol."

Well, my request for a way to output the <?xml> header albeit using
"html" output isn't that far off, is it? Of course the meta tags do
specify a character set as in "higher-level protocol". But that isn't a
reason not to output that header anyway.

Erich Schubert
   erich@(vitavonni.de|debian.org)    --    GPG Key ID: 4B3A135C    (o_
     We can debug relationships, but it's always good policy to     //\
     consider the people themselves to be features. People get      V_/_
         annoyed when you try to debug them. -- Larry Wall
     Nichts läßt die Erde so geräumig erscheinen, als wenn man
         Freunde in der Ferne hat. --- Henry David Thoreau
<?xml version="1.0" encoding="UTF-8"?>
<foo>Thanks for the flame</foo>
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; >
<xsl:output method="xml" encoding="iso-8859-1" doctype-public="-//W3C//DTD XHTML 1.1//EN" doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"; />
<xsl:template match="/">
<html><head><title>Flaming sucks</title></head>
<body>While help would be appreciated<br />
Thank you.</body>
<?xml version="1.0" encoding="iso-8859-1"?>
<!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><title>Flaming sucks</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head><body>While help would be appreciated<br />
Thank you.</body></html>

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]