RE: [xsl] Exclude Doctype for output HTML

Subject: RE: [xsl] Exclude Doctype for output HTML
From: "Scott Trenda" <Scott.Trenda@xxxxxxxx>
Date: Mon, 5 Nov 2007 13:39:47 -0600
I'm assuming that by "base template", you mean you have a main
stylesheet that does the bulk of your transforms, and that stylesheet
accepts a parameter that specifies which part of the stylesheet you want
to use for your output. And one of those parts produces the option list
you described below.

If that's the case, then the answer is no. Only one output method can be
declared per stylesheet. You'll need to split off the <option> section
into its own stylesheet, and that stylesheet can have <xsl:output
method="html"/> without any doctype declarations. You can use that one
for your AJAX transformation. However, if that <option> section is
needed in the base stylesheet, you could import it via an <xsl:import>;
in that case, the templates defined within the <option> stylesheet will
be available to the base, and the base stylesheet will output with the
correct doctypes as you'd specified; the <xsl:output method="html"/>
from the imported stylesheet will be overwritten by the <xsl:output/> in
the base stylesheet.

Hope that helps!

~ Scott

-----Original Message-----
From: Karl Stubsjoen [mailto:kstubs@xxxxxxxxx]
Sent: Monday, November 05, 2007 1:16 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: [xsl] Exclude Doctype for output HTML

I need to exclude the doctype decleration from the output for HTML.
There is a base template which sets the output type to HTML and
includes a doctype decleration there, but in the child template I need
to override and exclude the doctype output.  Is this possible.

Platform:  .NET 2.0 XSLT 1.0

The problem:  For an Ajax request, I need to return the <option>
elements for my selector element.  IE does not care to well for the
additional doctype decleration in the selector element.  So I'm
doctype + <options>...</option><option>...</option>



Current Thread