xsl-list
[Top] [All Lists]

Re: HTML Output & PI

2002-10-31 08:46:10

Thanks Michael & David,

I am assuming the automatic detection of HTML was introduced to make it 
possible to write simplified stylesheets (i.e. no xsl:stylesheet). I guess it 
would be too much to make these optional behaviors in a future version of 
XSLT to allow for the optimization and the removal of this nastiness.

Kev.

On Wednesday 30 Oct 2002 5:34 pm, Michael Kay wrote:
It's a good question. Saxon buffers the formatted comments and PIs until
it knows what the output method is. Technically I suppose it should
buffer the unformatted events and only format them when it knows the
output method.

I would love to file this under "not important enough to worry about"...

Not knowing the output method in advance is a pig: really, I would like
to know it statically, so that I can do the escaping of fixed text and
attribute values at compile time. But we have to live with the specs
that we're given...

Michael Kay
Software AG
home: Michael(_dot_)H(_dot_)Kay(_at_)ntlworld(_dot_)com
work: Michael(_dot_)Kay(_at_)softwareag(_dot_)com

-----Original Message-----
From: owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
[mailto:owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com] On Behalf Of
Kevin Jones
Sent: 30 October 2002 13:59
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] HTML Output & PI



I have a question on the output format for processing
instructions when no
output method is set. For HTML a XSLT processor is supposed to use
'>' rather than '?>' to terminate a processing instruction.
However if you
use,

<xsl:template match="/">
    <xsl:processing-instruction
name="a">b</xsl:processing-instruction>
    <html/>
</xsl:template>

with Instant Saxon 6.5 the output is,

<?a b?><html/>

I am assuming that Saxon does not determine the output should
be HTML until
after the PI has been output. To handle this correctly would
clearly require
some form of output lookahead is used when formating output
which would be
nasty to implement. So,

1. Is Saxon non-conformant here?
2. If it is are there likely to be any adverse effects?
Browser issues?

Thanks,
Kev.







 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>