Dear Tiberiu Tofan,
thanks for your code snippet, always welcome! Before including new code, I'd like to ensure that it will represent added value for other users as well, so.. may I ask what your XMLExtractSerializer class is supposed to do? Maybe it can also be realized via XQuery?
Christian ___________________________
On Mon, Dec 12, 2011 at 3:15 PM, Tiberiu Tofan tibtof@gmail.com wrote:
Hi, I work on a project involving some large xml files that we need to search for specific attribute values, and I tried a solution based on BaseX database. After several hours of searching I found no way to serialize the answer as I needed (the elements that had the searched attribute value and all their parents). As I only had two days for a proof-of-concept I made my own serializer and now the result is as I expect it to be. As I find these feature to be useful I attached the source code and maybe you'll consider to include such a feature in a future release. Unfortunately I had to hack Serializer.java, as the node() method was final, and I suggest you at least to make the Serializer more configurable (eg. a properties file for the serialization options and the class to use and then reflection, splitting the node() method into several override-able sub-methods). On the other hand, maybe there is a way to obtain the result I needed using the existing features of basex, but as I told you I hadn't much time and this seemed to me the quickest solution.
Best Regards, Tiberiu Tofan
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk