Subject: RE: question about transformation From: Mike Brown <mbrown@xxxxxxxxxxxxx> Date: Mon, 22 Nov 1999 11:46:24 -0700 |
Nicolas Yannick wrote: > > I've written a simple stylesheet to transform an XML document > > into another XML document that have a different dtd. > > I want to include at the begin of the transformed document > > the XML reference. An XSL stylesheet does not transform one XML document into another. It instructs an XSL processor how to create a result tree (of nodes) from a source tree that has been derived from an XML document. It also tells the processor you would prefer that it output that result tree somehow, perhaps as an XML document. Marco Mistroni wrote: > <xsl:template match="/"> > <?xml blah blah blah > </xsl:template> No. A stylesheet does not construct the output; it constructs the result tree of nodes from which output may be derived. The XML declaration and the DTD are not currently part of the source tree and they also cannot be inserted (as such) into the result tree. However, you can tell an XSLT 1.0 compliant processor that, when emitting the result tree as XML, you want a particular XML version and DOCTYPE. This is explained fully in section 16 of the XSLT 1.0 Recommendation: http://www.w3.org/TR/xslt#output ... it involves putting an <xsl:output/> element at the top of your stylesheet, with various attributes. If you are using IE5, you're out of luck, as the MS XSL processor is, as is often noted here, quite out of sync with current spec. XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
question about transformation, Yannick Nicolas | Thread | Announce: Stylus XSL Editor Now Ava, Carl Sjogreen |
Re: Simple XPath question, Phil Lanch | Date | RE: XSLT and non-closing HTML tags, Sean Chen |
Month |