xdg Digest, Vol 16, Issue 34

Timo Stülten timo at stuelten.de
Wed Jul 27 18:27:22 EEST 2005


Rodney Dawes wrote:
> On Wed, 2005-07-27 at 01:36 +0200, Timo Stülten wrote:
>>A lot of docbook files on my system only have <chapter>s in them. They do not 
>>have a DOCTYPE, nor any URI. 
>>Without a proper DOCTYPE/URI, there is no clean way to recognize them by 
>>content as <article> and <chapter> are not very specific to docbook I think. 
>>May be it's better to simply use a unique file extension (=".docbook")? All 
>>chapter-files on my system here already end in ".docbook".
> 
> However, we are not Windows, and should not rely solely on file
> extensions to assume content. Whatever application is writing out
> those "incomplete" docbook files, should probably be fixed to do the
> right thing, and write out a correct DOCTYPE and have proper reference
> to the DTD or namespaces being used, so that we can improve the accuracy
> of content type detection.
If I understand the XML spec correctly, DOCTYPE definitions are only 
allowed in the prolog of an well-formed XML-Document and namespace 
definitions only in the root node. XML-fragments cannot have DOCTYPE or 
namespace definitions and we cannot improve the accuracy of detection. 
Docbook apps writing fragments are not broken. The only solution I see 
is using unique file extensions for fragments.

-Timo-



More information about the xdg mailing list