Re: [xsl] where does one stick the doctype?

Subject: Re: [xsl] where does one stick the doctype?
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Fri, 21 Mar 2003 08:57:25 +0000
Chris Loschen wrote:
> My sense was that XSLT automatically puts the root element of your
> output document in your DOCTYPE line as you specified it in your
> stylesheet, so y ou don't have to do it yourself. That seems to have
> happened with all of my XSLT scripts to date. However, I'm not
> positive that's exactly what's happening -- does anyone know the
> real technical details?

Chris is correct, though since the result trees generated by XSLT can
have more than one top-level element, technically you get the name of
the *first* top-level element. The full details at
http://www.w3.org/TR/xslt#section-XML-Output-Method say:

  If the doctype-system attribute is specified, the xml output method
  should output a document type declaration immediately before the
  first element. The name following <!DOCTYPE should be the name of
  the first element. If doctype-public attribute is also specified,
  then the xml output method should output PUBLIC followed by the
  public identifier and then the system identifier; otherwise, it
  should output SYSTEM followed by the system identifier. The internal
  subset should be empty. The doctype-public attribute should be
  ignored unless the doctype-system attribute is specified.

Cheers,

Jeni

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


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


Current Thread