Project

Profile

Help

Expression Visitor

Added by Anonymous about 19 years ago

Legacy ID: #3397082 Legacy Poster: Eric P. Wittmann (paalin)

I have a small suggestion with regards to analyzing and manipulating an Expression in Saxon. In particular, I have been using the XQuery API, and I had a need to statically analyze an XQuery (in order to look for certain function calls etc..). Currently I use the static query context to compile the query into a XQueryExpression. Next, I walk the tree using iterateSubExpressions() to find the sub expressions that I am interested in (primarily FunctionCall instances). The suggestion: it would be really nice if there was a Visitor pattern here, so that it wouldn't be necessary to do a bunch of 'instanceof' checks. No big deal - but I think it would make Saxon even more useful since it could be used easily to parse, analyze, AND actually execute queries.


Replies (1)

RE: Expression Visitor - Added by Anonymous about 19 years ago

Legacy ID: #3397239 Legacy Poster: Michael Kay (mhkay)

Yes, I've had this refactoring in mind for a while, but there hasn't been a requirement that was strong enough to make it happen. Perhaps if I do an XQuery-to-XQueryX translator... It's the right thing to do, but I don't thing it's urgent. Michael Kay

    (1-1/1)

    Please register to reply