[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Exclude Doctype for output HTML

Subject: Re: Exclude Doctype for output HTML
From: "Karl Stubsjoen" <kstubs@xxxxxxxxx>
Date: Mon, 5 Nov 2007 14:13:30 -0700
Re:  Exclude Doctype for output HTML
Hi Scott, I dont' mean to imply that I'm doing it in reverse order, I
think I am doing it as you have described.  For clarification I have:

Ajax Template
Page Template
Base Template

In the base template I have output method = html and doctype argument filled in.
In page template, I'm assuming this inherits the base template output
method.  In the Ajax template, I'm assuming this inherits the page
template which inherits the base template output method and doctype.
To overcome the doctype output, I specificy in the Ajax template that
the output should be HTML but with no doctype specification.  This is
not working as expected.

As it turns out, IE does not do well in an Ajax request when you are
returning html elements without a parent element.  So a bunch of
<option></option> elements throws off IE.  Instead, and as a
workaround I am returning <select><option></option></select>. Problem

So I am wondering, this must be an IE issue, as it is not an issue in
Firefox.  Anyone else have any clues as to this behaviour?



On 11/5/07, Scott Trenda <Scott.Trenda@xxxxxxxx> wrote:
> 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:  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:  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


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.