[Xcb] naming convention again ;)

Jamey Sharp jamey at minilop.net
Mon Dec 12 17:48:58 PST 2005


On Mon, Dec 12, 2005 at 08:35:59PM -0500, Jeremy A. Kolb wrote:
> On Mon, 12 Dec 2005, Jamey Sharp wrote:
> > I may still be confused, but I think you missed my point. When
> > generating code for GetBooleanv from glapi.xml, why can't you do
> > something like this XPath query across XCB's glx.xml?
> > 	request[@name="GetBooleanv"]/reply/list/@name
> > 
> > That particular example will evaluate to "data" -- so you shouldn't have
> > to hardcode that string anywhere.
> 
> Oops. I think I missed your point then. What's an XPath query?

XPath is just a W3C standard way to identify particular nodes in an XML
document. The expression I quoted above says, "Look for a tag named
<request> that has an attribute 'name' with value 'GetBooleanv'. Look
inside that <request> for a <reply> tag; look inside that for a <list>
tag; and return the 'name' attribute of the <list>."

But obviously XPath is not the only way to find a particular attribute
in an XML document tree, so you should be able to do the same thing no
matter what tools you're using; XPath is just a nice terse language for
expressing these things.

--Jamey
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.freedesktop.org/archives/xcb/attachments/20051212/806c3473/attachment-0001.pgp


More information about the Xcb mailing list