[XML-DEV Mailing List Archive Home]
[Reply To This Message]
RE: Text based search or Xpath search
- To: mike@s..., bob@o...
- Subject: RE: Text based search or Xpath search
- From: "Ram Sundar" <ram0812@h...>
- Date: Mon, 09 Jan 2006 10:49:02 +0100
- Cc: xml-dev@l...
- In-reply-to: <BAY0-MC6-F9B3yz0UJq00233bbf@b...>
Ok, thanks Mike. I think I need to try the XPATH and do some profiling on time before making concrete decisions.
I appreciate all your responses guys!
From: "Michael Kay" <mike@s...>
To: "'Ram Sundar'" <ram0812@h...>,<bob@o...>
Subject: RE: Text based search or Xpath search
Date: Mon, 9 Jan 2006 08:52:02 -0000
If the XML is a file on disk, then it's going to have to be read from disk and parsed into a tree structure before XPath can operate on it. This is likely to take longer than the actual XPath evaluation. However, if you are doing repeated XPath searches, then the parsing only needs to be done once (you can hold the tree in memory).
----------------------------------------------------------------- The xml-dev list is sponsored by XML.org , an initiative of OASIS The list archives are at http://lists.xml.org/archives/xml-dev/ To subscribe or unsubscribe from this list use the subscription manager:
Yes, i guess you have a point. The whole purpose of storing the meta data in the text file was for optimising the speed. But unfortunately handling of large amount of data is slow.
I thought that by using the XML XPATH, I need not go through all the other data (by not doing a file.readline) if I wanted to search for documents with a certain name thus saving some time. But perhaps XPATH has to go through the whole document anyway.
Or am I cycling out in the forrest?
From: Bob Foster <bob@o...>
To: Ram Sundar <ram0812@h...>
Subject: Re: Text based search or Xpath search
Date: Sun, 08 Jan 2006 17:51:22 -0800
>A raw text file search should be way faster, but it really depends
>on how you're doing the search.
>Ram Sundar wrote:
> > Hi,
> > I have a text file that contains all the meta data of
> > folders like name, created date, modified date, owner etc. I
> > this text file everytime a user wants to search for the meta data
> > through python. I have a web interface where the user can input
necessary parameters he/she wants to search for. But, this
> > reading the information from the text file is slow. It becomes
> > slow, if there is quite a lot of information to go through,
> > Now, I was thinking that I can store the meta data as an XML file
> > instead and use the XPATH option available in python to retrieve
> > necessary information.
> > Do you guys think that storing the data in an XML file and using
> > XPATH search will be faster than the text file search?
> > Thanks for you input in advance,
> > Ram
>The xml-dev list is sponsored by XML.org
>initiative of OASIS <http://www.oasis-open.org>
>The list archives are at http://lists.xml.org/archives/xml-dev/
>To subscribe or unsubscribe from this list use the subscription
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format
Stylus Studio has published XML-DEV in RSS and ATOM formats,
enabling users to easily subcribe to the list from their preferred news reader application.
Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website.
they were not included by the author in the initial post. To view the content without the Sponsor Links please