[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
Re: [xsl] Can XSLT Remove
Re: [xsl] Can XSLT Remove
Subject: Re: [xsl] Can XSLT Remove <!DOCTYPE...
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Fri, 13 Apr 2001 10:17:11 +0100
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
- [xsl] Can XSLT Remove <!DOCTYPE...
- paulhoward.co.uk - Thu, 12 Apr 2001 23:30:08 +0100
- Mike Brown - Thu, 12 Apr 2001 16:25:47 -0600 (MDT)
- Jeni Tennison - Fri, 13 Apr 2001 10:17:11 +0100 <=
- <Possible follow-ups>
- RSuiter - Fri, 13 Apr 2001 09:48:51 -0500
<- Previous Index Next ->
Re: [xsl] Can XSLT Remove <!DOCTYPE, Mike Brown
Thread
Re: [xsl] Can XSLT Remove <!DOCTYPE, RSuiter
Re: [xsl] grouping question, Jeni Tennison
Date
RE: [xsl] select only first node, Kristof Bernaert
Month
Subject: Re: [xsl] Can XSLT Remove <!DOCTYPE... From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx> Date: Fri, 13 Apr 2001 10:17:11 +0100 |
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Can XSLT Remove <!DOCTYPE, Mike Brown | Thread | Re: [xsl] Can XSLT Remove <!DOCTYPE, RSuiter |
Re: [xsl] grouping question, Jeni Tennison | Date | RE: [xsl] select only first node, Kristof Bernaert |
Month |