# [EMAIL PROTECTED] / 2007-01-17 07:08:44 -0500:
> Mathijs van Veluw wrote:
> >Roman Neuhauser wrote:
> >># [EMAIL PROTECTED] / 2007-01-16 15:37:09 +0100:
> >>>Im using DomDocument currently and i realy want to prevent it from 
> >>>adding the !DOCTYPE and mabye even <html> and <body> etc..
> >>>Is this possible and how?
> >>
> >>Doesn't DOMDocument *require* DTD?  I thought it's either that or a
> >>"document fragment" (which is probably what you're looking for).
> >>
> >
> >And how should i do this?
> >Do you have any example avelable?
> 
> A DTD is not required and is not automatically added to XML documents.
> Tags are also not automatically added either (using loadHTML methods is 
> excluded from this statement) so not sure exactly what you are trying to 
> do here or running into. Are you just trying to serialize a DOMDocument?
> 
> <root /> is a perfectly well-formed document (though inclusion of xml 
> declaration is *highly* recommended).

Looks like the DTD is really optional, sorry for the noise.

prolog      ::= XMLDecl? Misc* (doctypedecl  Misc*)?
XMLDecl     ::= '<?xml' VersionInfo EncodingDecl? SDDecl? S? '?>'
VersionInfo ::= S 'version' Eq ("'" VersionNum "'" | '"' VersionNum '"')
Eq          ::= S? '=' S?
VersionNum  ::= '1.0'
Misc        ::= Comment | PI | S

http://www.w3.org/TR/2006/REC-xml-20060816/#NT-prolog

-- 
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE.             http://bash.org/?255991

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to