[PATCH wayland v2] Remove protocol/wayland.dtd

Pekka Paalanen ppaalanen at gmail.com
Fri Nov 6 03:26:10 PST 2015


On Fri, 6 Nov 2015 09:47:03 +1000
Peter Hutterer <peter.hutterer at who-t.net> wrote:

> On Thu, Nov 05, 2015 at 04:58:09PM +0200, Pekka Paalanen wrote:
> > On Mon, 19 Oct 2015 11:30:47 +1000
> > Peter Hutterer <peter.hutterer at who-t.net> wrote:
> > 
> > > On Fri, Oct 16, 2015 at 11:42:21AM +0300, Pekka Paalanen wrote:

> > > > If the original objection to a DTD was because it required manually
> > > > writing a lint phase in every project build system using the XML files,
> > > > then having wayland-scanner invoke the check automatically solves that.
> > > 
> > > the question that remains though is: the dtd must be an external file for
> > > extensions to be validated. Which means we need to either pass the dtd as
> > > argument to the scanner (requires makefile changes everywhere), or we
> > > hardcode the path into wayland-scanner (issues with running the scanner from
> > > within the source tree) or we add it as variable to pkgconfig (requires
> > > makefile changes again). any other solutions to fix this are welcome.
> > > even if all we do is call out to xmllint we still run into that issue.
> > 
> > Or, hopefully we can embed the DTD file into the scanner binary - is
> > there no way to let libxml2 read it as a plain string?
> 
> yep, just tested it here, it's a 3-line change to the patch to load from a
> string.

Cool.

> > I used the following trick to embed some files in Wesgr:
> > https://github.com/ppaalanen/wesgr/commit/02a840cb7db7eeb80071a353f66865d729738ae5
> 
> nice one. though if we're going for the embedded route anyway, we could just
> have it a const char in the scanner.c file. The dtd isn't really expected to
> change and when it does, the scanner needs to change too. Maybe we should
> just go for the easy route?

I'll let you pick the way. Should be easy to change it later if needed anyway.

Would it be bad if wayland-scanner embedded the DTD and in addition we
installed the DTD as a file too? So scanner used only its internal
copy. I'd probably try that if someone wants the DTD as a separate file
for their own use. In that case the trick would be handy.


Thanks,
pq
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 811 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20151106/955b624b/attachment.sig>


More information about the wayland-devel mailing list