You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Mike Gargiullo <mg...@smallworld.com> on 2000/08/01 21:21:00 UTC
RE: how to include a DOCTYPE on my xsl file
I'd like to find out so we can also spitout HDML for wireless devices.
-----Original Message-----
From: Ed Staub [mailto:estaub@mediaone.net]
Sent: Monday, July 31, 2000 7:52 AM
To: xalan-dev@xml.apache.org
Subject: RE: how to include a DOCTYPE on my xsl file
José Correia wrote:
>Thanks Ed, but there must surely be a way to specify the name to something
else
>other than 'html' ?? Scott?
RE: how to include a DOCTYPE on my xsl file
Posted by Jarno Elovirta <ja...@codeonline.com>.
I wrote an HDML formatter to Xalan 1.x, using FormatterToHTML as a basis.
Since in Xalan there's no possibility to disable output escaping in
attributes (like in SAXON as an extension), you need to escape $ characters
in your style sheet and there were some other problems with escaping, too.
Also, because the UP.Browser 4.0 has a bug where the TASK attribute has to
appear before RECEIVE attribute, I have to do some attribute sorting. I can
ask my boss if I can make it public domain/Apache license if someone's
interested - it's basically a hack, but it works for us.
Jarno - Hocico: Banished
-----Original Message-----
From: Ed Staub [mailto:estaub@mediaone.net]
Sent: 1. elokuuta 2000 23:42
To: xalan-dev@xml.apache.org
Subject: RE: how to include a DOCTYPE on my xsl file
I think you have more significant problems, probably with the output
encoding;
see http://4xt.org/downloads/examples/outputhandlers/hdml/.
Sorry, I'm not an HDML master.
However, looking at the spec, I see no allowance for a <!DOCTYPE>, so I'm
wondering why you want one.
Does anyone have an HDML output handler for Xalan?
(or Mike, are you using Cocoon? In which case your mileage will vary.)
RE: how to include a DOCTYPE on my xsl file
Posted by Ed Staub <es...@mediaone.net>.
RE: how to include a DOCTYPE on my xsl fileI think you have more significant
problems, probably with the output encoding;
see http://4xt.org/downloads/examples/outputhandlers/hdml/.
Sorry, I'm not an HDML master.
However, looking at the spec, I see no allowance for a <!DOCTYPE>, so I'm
wondering why you want one.
Does anyone have an HDML output handler for Xalan?
(or Mike, are you using Cocoon? In which case your mileage will vary.)
-Ed
-----Original Message-----
From: Mike Gargiullo [mailto:mgargiullo@smallworld.com]
Sent: Tuesday, August 01, 2000 3:21 PM
To: 'xalan-dev@xml.apache.org'
Subject: RE: how to include a DOCTYPE on my xsl file
I'd like to find out so we can also spitout HDML for wireless devices.
-----Original Message-----
From: Ed Staub [mailto:estaub@mediaone.net]
Sent: Monday, July 31, 2000 7:52 AM
To: xalan-dev@xml.apache.org
Subject: RE: how to include a DOCTYPE on my xsl file
José Correia wrote:
>Thanks Ed, but there must surely be a way to specify the name to
something
else
>other than 'html' ?? Scott?
From the spec (http://www.w3.org/TR/xslt#section-HTML-Output-Method):
"If the doctype-public or doctype-system attributes are specified,
then the html output method should output a document type
declaration
immediately before the first element.
The name following <!DOCTYPE should be HTML or html."
If your output-encoding is XML (not HTML), then from
http://www.w3.org/TR/xslt#section-XML-Output-Method:
"The name following <!DOCTYPE should be the name of the first
element."
Also, the XML spec states
(http://www.w3.org/TR/1998/REC-xml-19980210#sec-prolog-dtd):
"Validity Constraint: Root Element Type
The Name in the document type declaration must match the element
type of
the root element. "
So I'm not sure why you would want the name to be anything other than
HTML;
it's invalid XML.
The relevant code is at
org.apache.xalan.xpath.xml.FormatterToHTML.startDocument():
accum("<!DOCTYPE HTML");
So there aren't any proprietary Xalan escape hatches.
At the risk of exposing my lack of imagination... why do you need this?
-Ed
--------------
Ed Staub wrote:
> You want something like:
>
> <xsl:output method="xml" encoding="US-ASCII"
> doctype-system="readerAssessment.dtd"
> doctype-public="-//EDUFLEX.COM//DTD ASSESSMENT 1.0//EN"/>
>
> The doctype name must be 'html'; you have no control over it.
> See http://www.w3.org/TR/xslt#section-HTML-Output-Method (near the
bottom)
> for the full specification.
>
> -Ed Staub
>
> -----Original Message-----
> From: Jose Correia [mailto:jose@exinet.co.za]
> Sent: Friday, July 28, 2000 2:33 AM
> To: xalan-dev@xml.apache.org
> Subject: how to include a DOCTYPE on my xsl file
>
> Hi all
>
> I'm trying to do the following:
>
> <?xml version="1.0"?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> version="1.0">
> <xsl:output method="xml" encoding="US-ASCII"/>
>
> <xsl:template match ="assessment">
> <!DOCTYPE assessment PUBLIC "-//EDUFLEX.COM//DTD ASSESSMENT 1.0//EN"
> "readerAssessment.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml">
> <head>
> <title><xsl:value-of select ="@name"/> </title>
>
> </head>
> </html>
> <xsl:apply-templates/>
> </xsl:template>
> </xsl:stylesheet>
>
> Everything works except for line 6 (DOCTYPE). The processor complains
> saying:
> "org.apache.xalan.xslt.XSLProcessorException: The content of elements
must
> consist of well-formed character data or markup."
>
> Any ideas on how to include that DOCTYPe to the ouput file. I tried
wrapping
> it
> in a <xsl:text> but to no avail (same error).
>
> Thanks
> Jose