[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: where does one stick the doctype?
[ Chris Loschen] > > >I understand that a DOCTYPE declaration can contain any > valid element in > >the DTD. But I'm wondering if there's a way that XSL can insert this > >element name when it creates the declaration via xsl:output or > >xsl:document. > > 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? > > You do not need a "sense". The xslt 1.0 Rec tells you (section 16.1, for the xml output method) - "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." So the serializer will create a DOCTYPE declaration that names the document element, exactly as desired. There are no facilities to create anything different from this, but this is generally what you want. Because this is a requirement levied on the serialized output, you will not get it if you use non-serialized results, like a DOM that you hand off for further processing. Cheers, Tom P XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|