I've tried something like this. I stored 30,000 (approx. 62K each) documents of the same type. As I stored each one, I added an attribute (@id="n") to the root element. I also added an index ([EMAIL PROTECTED]) to the collection. With the help of the index, I was able to return any single document in an average time of 266 ms, using a pedestrian XPath query. With an optimized query, it might run even faster..
> -----Original Message----- > From: Lixin Meng [SMTP:[EMAIL PROTECTED] > Sent: Wednesday, February 19, 2003 10:42 PM > To: [email protected] > Subject: RE: Parse tree structures/collections with xPath and xindice > > Just one quick idea. > > Assume that your original big menu file looks like below, (it is same as > the > one in your email, but with the '@id' that implies the hierarchy): > > <menu id='m1'> > <props> > ... > </props> > <menu id='m11'> > <props> > ... > </props> > <menu id='m111'> > <props> > ... > </props> > </menu> > <menu id='m112'> > <props> > ... > </props> > </menu> > </menu> > </menu> > > Save them into a single collection '/db/mymenus' as separate files: > > -- file1.xml ----- > <menu id='m1'> > <props> > ... > </props> > </menu> > > -- file11.xml ----- > <menu id='m11'> > <props> > ... > </props> > </menu> > > -- file111.xml ----- > <menu id='m111'> > <props> > ... > </props> > </menu> > > -- file112.xml ----- > <menu id='m112'> > <props> > ... > </props> > </menu> > ... > > When perform lookup, try things like: > /menu[starts-with(@id, 'm1')] > It will grab all related sub-menu at once, if that's what you concerned > about the performance. > > Just some thoughts. No test performed. > > Regards, > Lixin > > ------------------------- > XDataFinder, another way to browse XML database > http://www.brownpot.com/sw_profile.html > > > > -----Original Message----- > From: Florian Schaper [mailto:[EMAIL PROTECTED] > Sent: Wednesday, February 19, 2003 7:13 PM > To: [email protected] > Subject: Parse tree structures/collections with xPath and xindice > > > Hello, > > I guess this problem already has been addressed a few dozen times already > but I couldn't find a specific enough answer in the archives and after all > openSource is fast to develop so I will state my question anyway ... > > I want to store a tree like structure in Xindice say > > menu > ....menu > .....menu > ........menu > > my solution would now have been to split this single file (which becomes > quite large) into single "property" documents in menu collections like > /db/mymenus/menuID1/menuID7/... or something like that .. > > however I still would need to query all that in xPath as an single > document > like //[EMAIL PROTECTED]'blah'] > > A few tests and a brief look in the archives are somewhat discuraging but > maybe I missed something (I hope so cause like the project desciption > states > "free directory/tree structures are the strength of XML" ... ) > If not maybe somebody has already a good concept to "simulate" this and > still keep adequate performances for lookups? > > > <menu> > <props> > ... > </props> > <menu> > <props> > ... > </props> > <menu> > <props> > ... > </props> > </menu> > <menu> > <props> > ... > </props> > </menu> > </menu> > </menu> > > > ./regards > > Florian > > > ------------------------------------------------------------------------------ CONFIDENTIALITY NOTICE: If you have received this e-mail in error, please immediately notify the sender by e-mail at the address shown. This e-mail transmission may contain confidential information. This information is intended only for the use of the individual(s) or entity to whom it is intended even if addressed incorrectly. Please delete it from your files if you are not the intended recipient. Thank you for your compliance. Copyright (c) 2003 CIGNA ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
