Re: Can XSLT Remove <!DOCTYPE...
Hi Paul, Mike Brown wrote: > paulhoward.co.uk wrote: >> Ive scoured the archives and Dave's FAQ but I cant find anyway XSLT >> can be used to remove <!DOCTYPE.... > tags from input files. > > XSLT should never see these, since they are not part of the XPath > data model. They are not intended for the application to see, > anyway; they are for the XML parser's benefit. XSLT operates on > parsed XML documents, not the raw input. For the same reason, > character and entity references are not accessible from within > XPath/XSLT. And just to spell out the implication of this... it means that if you copy an XML document using XSLT, then the copy of that document will not include the DOCTYPE declaration. So in effect, you can use XSLT to 'remove' the DOCTYPE declaration from a document with just one template: <xsl:template match="/"> <xsl:copy-of select="." /> </xsl:template> There may be other differences between the two documents because the DTD is missing - the generated document may have extra attributes because of default attributes within the DTD, and it will not have any entities aside from the built-in ones. But logically it will be the same document. I hope that helps, Jeni --- Jeni Tennison http://www.jenitennison.com/ 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