Re: [basex-talk] Import a large XML file and add an attribute on all children

2014-10-31 Thread Fabrice Etanchaud
Such a preprocessing transformation step would be very useful. In order to do that entirely in BaseX, I load the data twice. Once in a temporary collection (that may be an in memory collection), from where I perform the transformations. Then I load the transformed data in the final collection.

Re: [basex-talk] Import a large XML file and add an attribute on all children

2014-10-31 Thread Mallika Jimmy
Hello Etanchaud, Such a preprocessing transformation step would be very useful. This means that BaseX does not have such a tranformation step at present. To achieve this in the current BaseX version, what would be the efficient method? I have now tried creating database by importing the XML

Re: [basex-talk] Import a large XML file and add an attribute on all children

2014-10-31 Thread Fabrice Etanchaud
If you use XQuery update facility, I agree that adding a attribute on every element will lead to a huge pending update list that could fill your ram. I suggest to process your data in smaller partitions. For each partition, You could transform your data with a recursive function and store it in

Re: [basex-talk] Import a large XML file and add an attribute on all children

2014-10-31 Thread Christian GrĂ¼n
Hi Mallika, Then inserting attribute on all child nodes using an xquery recursive function. You could try to use XQuery Update and a simple loop: for $a in db:open('your-database')//* return insert node attribute x { 'yz' } into $a I would be interested if such a call can be evaluated

Re: [basex-talk] Import a large XML file and add an attribute on all children

2014-10-31 Thread Fabrice Etanchaud
Malika, Is this attribute a kind of annotation or index ? If you need to annotate/index your data, I suggest not to mix source data and annotations, But to create a annotation/indexation collection afterwards. Maybe node-pre functions could help you ? You could create a separate collection