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

Re: Can XSLT Remove <!DOCTYPE...

Subject: Re: Can XSLT Remove <!DOCTYPE...
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Fri, 13 Apr 2001 10:17:11 +0100
xsl 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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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.
Email
First Name
Last Name
Company
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.