After all... xquery is the xml equivalent of grep. Imagine! Landing in an OS with no grep equivalent!
Oh, wait... I just described windoze...
I wrote a small piece of XLS wrapped in a script( xsnap.sh) the script got a slightly more complicated once I found out that if an input document has a namespace defined, you have to use it in your expression.
Now this is handled like magic, but can be turned off by uncommenting the line "XSNAP_SMARTY" then you can specify "xsnap:expression" to match the default ns of the document.
Here is the dealio: xsnap.sh "groupId/text()" pom.xml
junit
hsqldb
...
And viola! A "grep-like" tool for xml!
This mechanism is more robust that just grepping xml since it uses the xquery standard junk.
No comments:
Post a Comment