HACKER Q&A
📣 Grayskull

Does Anybody Use XQuery?


I am currently working on where I plan to do configuration through xml file and it got me me thinking "I could learn XQuery and use it." Since XQuery is at least by my understanding "SQL for XML". But when looking for ways to use it. I thought "Does anybody actually use it?" and "How off am I actually understanding it?"


  👤 mattmanser Accepted Answer ✓
XQuery is pretty powerful, and I used it extensively with xlst in the 2000s, but it's a dead tech and not something you should ask your users to use.

Just use JSON.

Also, if you absolutely insist on using it, do not use namespaces, and avoid attributes. All us older timers could tell you about the number of frustrating XML configs we had to deal with that had overcomplicated or completely irrational structures. And namespaces and attributes were the biggest offenders.


👤 weitzj
Well, I don't use it right now. But really Xquery is a great language and you can do lots of things. I used it with XSLT a lot. I am still forcing myself to find the correct query for jq when I want to look through a JSON. Xquery felt well defined.

👤 smitty1e
My sense is that JSON and jq won the Battle of the Internet Hierarchical Structured Data Strings competition.

👤 slipwalker
given XML is a "first class citizen" datatype on Microsoft SQLServer 2012 ( used on my day job ) yes, i am kind of forced to use xquery...