RE: [xml-dev] xsl -- Inserting a DOCTYPE if needed

From
Michael Kay <>
To
"'Caro, Samuel'" <>,
Date
2002-03-12T09:48:03
ID
<000901c1c9ab$01ae8650$835169d5@pcukmka>
Thread
RE: [xml-dev] xsl -- Inserting a DOCTYPE if needed
> How would write a XSL file that inserts the DOCTYPE only and
> only if not present?
>

You can't. The DOCTYPE declaration is not part of the InfoSet or the XPath
data model, therefore your stylesheet can't determine whether or not the
original document had a DOCTYPE or not.

Michael Kay
Software AG
home: 
work: