On 03/04/18 10:13, Lawrence D'Oliveiro wrote: > On Tue, 3 Apr 2018 09:36:27 +0100, Peter Flynn wrote: > >> Do you have examples or documentation of valid Fontconfig XML configs > > Have you tried looking in the Fontconfig source? I had, but had failed to find the files. Thanks for the pointer. >> A validating XML parser on its own doesn't do anything either > > On the contrary, No, you didn't read what I wrote: "on its own". Of course it will do something if you feed it a file. > Fontconfig’s config parser does everything we need it to do: accept > exactly that set of valid config files and reject everything else. So the problem is *what* exactly? It's admittedly an interesting use case for XML, but it's what XSLT does (in a different way). > And it doesn’t just provide syntactic validation, but also semantic > validation as well: we can use it to test that the config does in > fact do what we expected it to do. That sounds fine. But that's an application function. The DTD's task is to inform a validating XML parser (like one in an editor, or in your C code) what markup is allowed and where, so it can detect whether an instance conforms to it or not, and what the current instance contains. The only errors in the current DTD are that it's missing the element type 'description', and missing the element types in the its: namespace. Having made those changes, all the files validate just fine (diff attached). If there is no risk that someone will accidentally type bogus characters into the element type like int, then I don't see any need to use anything else. The DTD in this case is basically a placeholder for validation which is done elsewhere (in the C code, for example). >> I think someone may have misunderstood what XML is for. > > No, I think you have misunderstood what DTDs are for. :-) I don't think so. Thanks for the explanations. ///Peter
1a2,4 > <!-- Updated to include its: namespace element types and the > description element type; 2018-04-03 PF --> > 8c11,13 < match | --- > match | > description | > its:rules | 9a15,24 > > <!-- additions for ITS : 2018-04-03 PF --> > <!ELEMENT its:rules (its:translateRule)> > <!ATTLIST its:rules xmlns:its CDATA #FIXED "http://www.w3.org/2005/11/its" > version CDATA #REQUIRED> > <!ELEMENT its:translateRule EMPTY> > <!ATTLIST its:translateRule translate (yes|no) #REQUIRED > selector CDATA #REQUIRED> > <!-- end additions for ITS --> > <!ELEMENT description (#PCDATA)>
_______________________________________________ Fontconfig mailing list Fontconfig@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/fontconfig