[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

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 14:59:10 -0600

So you're essentially doing the imports in reverse from the order that
I'd recommended. As far as I know, the .NET processor is doing it
correctly. If you're not specifying a doctype in the main template, the
XSLT processor looks for one in any of the imported stylesheets, which
is where it's getting it from. Try specifying this in your AJAX
stylesheet first:
<xsl:output method="html" doctype-public="" doctype-system=""/>

If that doesn't work, take a shot at the other order of imports that I'd
recommended before.

~ Scott


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

Ok, I am imorting my base template, and am overriding the root
template match for the Ajax request.  I have an xsl:output method to
HTML with no doctype specification here, but it does exist in the
imported template.  So effectively, I am doing what you are
suggesting.  Is it the .NET processor throwing that in there?
Could it be, that with no top level element, that the .NET processor
doens't process this properly?

Karl..

On 11/5/07, Scott Trenda <Scott.Trenda@xxxxxxxx> wrote:
> 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
> getting:
> doctype + <options>...</option><option>...</option>
>
> Thanks,
>
> Karl..


Current Thread
Keywords