OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

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

[ Lists Home | Date Index | Thread Index ]

On Tue, Mar 12, 2002 at 09:48:03AM -0000, Michael Kay wrote:
> > 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.

  Actually the Infoset has that information:
  "The Document Type Declaration Information Item"
  http://www.w3.org/TR/xml-infoset/#infoitem.doctype

But this is missing from XPath and hence not available to XSLT processing
(at least for 1.0).

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.redhat.com/
veillard@redhat.com  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS