[xquery-talk] contains(), matches(), highlight-matches()

Joe Wicentowski joewiz at gmail.com
Fri Jul 5 22:17:01 PDT 2013


Hi all,

Today I posted some code [1] with a function for highlighting regex
matches in an XML node.  I'd appreciate any comments or improvements
to the code (via response here, pull requests, or whatever method is
best for you).

I also wrote an accompanying post [2] for relative beginners to
XQuery.  While seasoned programmers probably come up this function on
the first day they learn XQuery, I think it's beyond most
XQuery-first-programmers like I was when I began.  Yet I think the
function is so basic that in my post I ventured to call it XQuery's
"missing third function" - the first two being contains() and
matches().

I'm curious: Was a function like this impossible to write in pure
XQuery before 3.0's support for fn:analyze-string() and higher order
functions?  Surely, if it had been possible, it would've been in the
functx library.

Thanks in advance for your insights,
Joe (@joewiz on twitter)

[1] https://gist.github.com/joewiz/5937897

[2] http://joewiz.tumblr.com/post/54729725793/xquerys-missing-third-function


More information about the talk mailing list