Sure. xmllint, which comes with libxml2 (libxml2-utils in Ubuntu), supports RELAX NG these days.<div><br></div><div><div>scout:protocol jvolkman$ xmllint --noout --relaxng schema.xml wayland.xml</div><div>wayland.xml validates</div>
</div><div><br></div><div>-Jeremy</div><div><br><div class="gmail_quote">2011/1/27 Kristian Høgsberg <span dir="ltr"><<a href="mailto:krh@bitplanet.net">krh@bitplanet.net</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Wed, Jan 26, 2011 at 5:09 PM, Jeremy Volkman <<a href="mailto:jvolkman@gmail.com">jvolkman@gmail.com</a>> wrote:<br>
> Here's my stab at a Wayland schema written in RELAX NG. It can be converted<br>
> to a W3C schema if preferred, but RELAX NG provides more functionality. For<br>
> example, the schema is able to require an "interface" attribute for an<br>
> argument only if the argument type is "object" or "new_id".<br>
> -Jeremy<br>
<br>
</div>Is there a tool that can verify the protocol against the schema?<br>
<font color="#888888"><br>
Kristian<br>
</font><div><div></div><div class="h5"><br>
> 2011/1/26 Kristian Høgsberg <<a href="mailto:krh@bitplanet.net">krh@bitplanet.net</a>><br>
>><br>
>> 2011/1/26 Casey Dahlin <<a href="mailto:cdahlin@redhat.com">cdahlin@redhat.com</a>>:<br>
>> > On Wed, Jan 26, 2011 at 01:40:25PM -0500, Kristian Høgsberg wrote:<br>
>> >> 2011/1/26 Josh Leverette <<a href="mailto:coder543@gmail.com">coder543@gmail.com</a>>:<br>
>> >> > I'm not certain, but I think there could eventually be enough<br>
>> >> > variation for that to be needed. However, even if there isn't, parsing an<br>
>> >> > XML file might be a better long term solution that weakly linked functions<br>
>> >> > and things like that. Perhaps we could modify his idea about an XML profile<br>
>> >> > structure to allow you to delve into each supported profile and find out<br>
>> >> > more about what it supports without having to hard code acceptable version<br>
>> >> > numbers into a program. The only problem I foresee is how to modify the XML<br>
>> >> > file. It's not going to be the end user's job.. but if any program could<br>
>> >> > modify it there needs to be a fallback system to prevent a rogue program<br>
>> >> > from deleting other profile advertisements written in by the system or other<br>
>> >> > programs.<br>
>> >><br>
>> >> The XML file isn't used at runtime. It's just a convenient mechanism<br>
>> >> to describe the interface. The way it works is that a client connects<br>
>> >> to the server and the server will then advertise all the global<br>
>> >> objects available by giving their object id, interface name and<br>
>> >> version. A client can then look through the list to see what's<br>
>> >> available and adjust its behaviour accordingly.<br>
>> >><br>
>> >> Kristian<br>
>> >><br>
>> ><br>
>> > Does the XML file have a particular schema?<br>
>> ><br>
>> > It might be useful to install it in /usr/share so it could be used by<br>
>> > tools. I'm thinking mostly of a d-feet style introspection tool for the<br>
>> > Wayland protocol (we could even go as far as dynamically adaptable<br>
>> > bindings for languages like Ruby or Python).<br>
>><br>
>> I didn't actually write a schema for it, but if somebody with the<br>
>> right XML-fu could do that that would be nice. It's a good point that<br>
>> dynamic languages probably just want to parse the XML directly and<br>
>> generate the bindings on the fly and for that we would need to install<br>
>> the XML. As for introspection/logging/xscope, that's built into the<br>
>> server side library: set WAYLAND_DEBUG=1 and watch the requests and<br>
>> events fly by.<br>
>><br>
>> Kristian<br>
>> _______________________________________________<br>
>> wayland-devel mailing list<br>
>> <a href="mailto:wayland-devel@lists.freedesktop.org">wayland-devel@lists.freedesktop.org</a><br>
>> <a href="http://lists.freedesktop.org/mailman/listinfo/wayland-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/wayland-devel</a><br>
><br>
><br>
> _______________________________________________<br>
> wayland-devel mailing list<br>
> <a href="mailto:wayland-devel@lists.freedesktop.org">wayland-devel@lists.freedesktop.org</a><br>
> <a href="http://lists.freedesktop.org/mailman/listinfo/wayland-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/wayland-devel</a><br>
><br>
><br>
</div></div></blockquote></div><br></div>