This works fine:
(sxml-match '(div)
((div) #t))
But this fails:
(sxml-match '(div)
((,element) #t))
I am wondering how to match any element?
This is a more concrete example. The following is a snippet from the XCB's "xproto.xml" file:
(define xproto '((struct (@ (name "CHAR2B"))
(field (@ (type "CARD8") (name "byte1")))
(field (@ (type "CARD8") (name "byte2"))))
(xidtype (@ (name "WINDOW")))
(xidtype (@ (name "PIXMAP")))
(xidtype (@ (name "ATOM")))
(xidunion (@ (name "DRAWABLE"))
(type "WINDOW")
(type "PIXMAP"))))
My aim is to extract the names:
(define names '((struct "CHAR2B")
(xidtype "WINDOW")
(xidtype "PIXMAP")
(xidtype "ATOM")
(xidunion "DRAWABLE")))
So I tried this:
(sxml-match xproto ((,kind (@ (name ,name)) . ,body) ...))
But I get the error:
bad pattern syntax (not an element pattern)
I do not understand what else I should do.
Is sxml-match
an insufficient tool for this job?