|
Content search for eXist
Related tags |
eXist blog entries
The echo.xq looks like this (assumes a lot...but is ASAP - as simple as possible): xquery version "1.0";
declare namespace xmldb="http://exist-db.org/xquery/xmldb";
declare namespace util="http://exist-db.org/xquery/util";
declare namespace request="http://exist-db.org/xquery/request";
declare option exist:serialize "method=xml media-type=text/xml indent=yes omit-xml-declaration=no";
let $data := request:get-data()
return
<Data>
{$data}
</Data>
I had to scrub some private data in a few thousands of xml documents stored in an eXist database. I used this: So, for e.g. let $ssn-ids := $collection//u:PersonSSNID[. != '888888888'] update value $ssn-ids with '888888888' The filter expression makes the xquery repeatable and precise. Look up the update extensions here: http://exist-db.org/update_ext.html#N101B9 for more details and other update mechanisms. Quite useful.
I was reviewing eXist documentation today. Ran into an article on how you can check for code quality using the http://pmd.sourceforge.net/ . What struck me was that you can express the checking rules in Java as well as XPath. The reason I am excited about the latter style is because recently I have been realizing that XPath has precise and very concise expressive power. Since OO classes exhibit an inherent inheritance either through Type hierarchy or composition, I have been wondering lately about using XPath bindings to query static code (Java) ; this has been particularly true in recent projects when reviewing code using IntelliJIdea's very effective code analysis system - I felt a "realtime" Java Static code query system using XPath would be cool! I am very glad someone else did the work for me! I am thinking of getting the book : http://pmdapplied.com by the author of the codebase. What a small world: eXist, XPath, Java, IntelliJIdea! On Windows, when launching eXist using "startup.bat" , I had to change the port settings on jetty.xml (default=8080). |
Notes Full-featured,standards-compliant XML database
http://exist-db.org/documentation.html is the main page for finding documentation.
http://exist.sourceforge.net/deployment.html has info about deployment. On Windows, I downloaded the executable jar. On running it, an installer was launched. I pretty much picked all defautlts; did not install as a service, which I probably should during deployment so its keep running on the background even after logging out of the machine. Quite smooth so far. By default it runs on port 8080. The "admin" user is not password protected. So it would be important to create a new user with dba (group is what they call) privileges but password protected and disable this. I also removed the guest user bad idea- do not else web UI fails. There is a "client" UI for administration too. But so far, I mainly used the web front-end of exist. Occasionally, when things went awry with exist web front-end I have had to restart the browser to clear the session. Also, I have had to rely on the GUI admin client tool that was installed to overcome some screwed up situations. Snippets
|

Add Comment