Re: DTD

Lawrence D'Oliveiro <[email protected]>
Newsgroups gmane.comp.fonts.fontconfig
Organization Geek Central
Message-ID <[email protected]>
On Mon, 2 Apr 2018 22:02:41 +0100, Peter Flynn wrote:

> On 01/04/18 22:10, Lawrence D'Oliveiro wrote:
>
>> The content for these is *not* “just strings”.  
> 
> But only a human can know that; it is probably documented somewhere
> else.

Fontconfig knows it too.

> The DTD says the content is "parsed character data", which is
> text with no further element markup; in effect "just strings", so
> that's it as far as SGML or XML is concerned if you use a DTD alone.

Precisely why a DTD is useless.

> A W3C Schema can constrain character data content more finely, and
> Schematron can apply additional validation rules.

Is it better to replace the DTD with a “Schematron”, then?

>> Given that it will accept files that are not valid Fontconfig
>> configurations, the validation function seems useless.  
> 
> What is "it" in this context? Fontconfig? Or the DTD? Maybe the DTD
> has been written incorrectly.

But you have just admitted that there is no way to write the DTD
correctly.

> A DTD can only be used to test validity within the constraints of what
> it has been told. If there are additional constraints which cannot be
> expressed in XML Declaration Syntax (DTD-speak) then Fontconfig should
> be using a different language like W3C Schema or RelaxNG.

Or maybe it should simply continue using what it already uses, a
language called C, which exactly accepts valid Fontconfig configs, no
more and no less
<https://cgit.freedesktop.org/fontconfig/tree/src/fcxml.c>.
_______________________________________________
Fontconfig mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/fontconfig
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.