Re: [xsl] Want to process XHTML in my XSL stylesheets.

Subject: Re: [xsl] Want to process XHTML in my XSL stylesheets.
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Mon, 8 Jul 2002 20:05:49 +0100
Hi Ed,

> First question: If I have XHTML in an XSL stylesheet, will it be
> validiated (e.g. are the XHTML elements in the XSL stylesheet
> checked against the XHTML syntax/schema, or does validation only
> involve the XML files being processed).

No, the XHTML in your stylesheet will not be validated. If it were
(naively), it would be invalid because XHTML can't contain elements
like xsl:apply-templates. There are some claims that XSLT 2.0
processors will have the intelligence, and XSLT 2.0 the robustness,
that would enable processors to check whether the XHTML that will be
generated from a given stylesheet will be valid or not, but for now at
least you need to test the output that you get with various inputs to
have any guarantee that you're generating valid XHTML.

> Second question: How do I get the XHTML embedded in the XSL
> stylesheet to come out as HTML. All the examples I have seen are
> addressing XHMTL embedded in the input XML being transformed, not in
> the XSL stylesheet specifying the transformations.

Set the output method to 'html' explicitly using the xsl:output
element at the top level of the stylesheet.

<xsl:output method="html" />

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


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


Current Thread