[racket] Test to disambiguate x-expression attributes vs. content?
Consider an x-expression that represents an XML tag, so it has the general
form
'(tag ((attr-name "attr-value") ... ) content ...)
The attributes or content might be omitted, of course.
When I recursively process these expressions, I start by decomposing the
x-expression into components:
tag
((attr-name "attr-value") ... )
(content ...)
The problem that surfaces in a recursive-processing context is that the
list of content might have the same form as an attribute expression, e.g.,
((field-1 "value-1") (field-2 "value-2"))
((p "some text") (p "some more text"))
*Is there a test I could use to reliably disambiguate between these two
cases*, short of creating a new struct for x-expressions? Seems like I'm
overlooking some middle ground.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20130610/a901554e/attachment.html>