Re: DTD

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
Fontconfig@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/fontconfig




[Index of Archives]     [Fedora Fonts]     [Fedora Users]     [Fedora Cloud]     [Kernel]     [Fedora Packaging]     [Fedora Desktop]     [PAM]     [Gimp Graphics Editor]     [Yosemite News]

  Powered by Linux