How to get file name + line number in query results

Tuesday, 28 January 2014 · 3 messages · last reply 29 Jan 2014
MZ
Moshe Zuisman28 Jan 2014 17:15 #
Hi. I am using base-X as kind of repository for my XML files, to perform queries over all files I use. Number and size of files are not a problem - it is some 100+ files , each one few hundreds lines. To be more specific - those are xml files of IzPack installation. I have loaded all my files into database and perform different kinds of queries there. It works great. Problem is - that after I have found desired data, I have to look at which file at which place it really is located. What I am doing now is - just copy into clipboard piece of resulting data and performing "search in files" at all my XML files directory. Finally - it works, but I am sure - there have to be better way to do it... Can I somehow modify my query to cause base-X to "say" me - where calculated result is located at original file system?
CG
Christian Grün29 Jan 2014 12:23 #
Dear Moshe, I agree that such a feature would be desirable. The original byte offset of an XML node will not be preserved as we try to minimize the size of our databases. One more reason is that such information gets invalid anyway after database updates. One question: What's your reason for looking up the data in the original file? Maybe there's some chance to stay in the XPath/XQuery world for the operations to follow? Other suggestions from the community are welcome, Christian
Quoted text · Moshe Zuisman · 15 lines
On Tue, Jan 28, 2014 at 5:15 PM, Moshe Zuisman <zuismanm at gmail.com> wrote: > Hi. > I am using base-X as kind of repository for my XML files, to perform queries > over all files I use. > Number and size of files are not a problem - it is some 100+ files , each > one few hundreds lines. To be more specific - those are xml files of IzPack > installation. > I have loaded all my files into database and perform different kinds of > queries there. It works great. > Problem is - that after I have found desired data, I have to look at which > file at which place it really is located. What I am doing now is - just copy > into clipboard piece of resulting data and performing "search in files" at > all my XML files directory. Finally - it works, but I am sure - there have > to be better way to do it... Can I somehow modify my query to cause base-X > to "say" me - where calculated result is located at original file system?
MZ
Moshe Zuisman29 Jan 2014 12:56 #
Hi. My xml files are actually XML definitions of different product installations for IzPack open source Installer. IzPack consists of 2 main part: JAVA written engine. Specific installation definitions in format of XML. Since our products are numerous and quite complicated - those XML definitions are quite complex and have a lot of interconnections... So - I loaded all them into base-X and use it to perform different queries through whole XML data. But - to remain in world of XQuery/Xpath - I have to rewrite substantial part of JAVA engine, that read/parse/manage those XMLs. It is a lot of work... 2014-01-29 Christian Grün <christian.gruen at gmail.com>
Quoted text · Christian Grün · 37 lines
> Dear Moshe, > > I agree that such a feature would be desirable. The original byte > offset of an XML node will not be preserved as we try to minimize the > size of our databases. One more reason is that such information gets > invalid anyway after database updates. > > One question: What's your reason for looking up the data in the > original file? Maybe there's some chance to stay in the XPath/XQuery > world for the operations to follow? > > Other suggestions from the community are welcome, > Christian > > On Tue, Jan 28, 2014 at 5:15 PM, Moshe Zuisman <zuismanm at gmail.com> wrote: > > Hi. > > I am using base-X as kind of repository for my XML files, to perform > queries > > over all files I use. > > Number and size of files are not a problem - it is some 100+ files , each > > one few hundreds lines. To be more specific - those are xml files of > IzPack > > installation. > > I have loaded all my files into database and perform different kinds of > > queries there. It works great. > > Problem is - that after I have found desired data, I have to look at > which > > file at which place it really is located. What I am doing now is - just > copy > > into clipboard piece of resulting data and performing "search in files" > at > > all my XML files directory. Finally - it works, but I am sure - there > have > > to be better way to do it... Can I somehow modify my query to cause > base-X > > to "say" me - where calculated result is located at original file system? >

⚡Generated with XQuery