in reply to Re: XML and file size
in thread XML and file size

searching in XML is much more expensive!!!

I'm not sure that I agree with that. If "searching" means checking whether a word or phrase occurs in the file then the time required to search would be almost identical for XML versus plain text - assuming you use the same code for each (save for the fact that the XML file will be a bit more verbose so extra I/O might be required in some cases).

On the other hand if you want to do semantic searches (eg: does this word or phrase occur within <title> ... </title> tags?) then sure that will take more CPU cycles than a plain text match but that is merely extra cost for extra power.

Replies are listed 'Best First'.
Re: Re: Re: XML and file size
by osama (Scribe) on Jan 08, 2003 at 03:29 UTC

    I have nothing against XML, and it can be used to store your data in some cases, but I think it's better suited for data interchange/SOAP/Having different formats for the same data.I'm actually comparing XML files to a database, to which they are frequently offered as an alternative, storing XML in a database is another thing.

    I never heard of anybody saying "I'll use XML files instead of text files"... It's mostly "Use XML and you don't need a database", I just cannot Imagine a search in 200,000 XML files looking for text in <title> tags. but imaginig "select body from pages where title like '%text%'" is easy.

    I think storing you data in any type of files XML/text/CSV... is a waste of time if you have lots of data (>1000 records? le ss? more?)

      I never heard of anybody saying "I'll use XML files instead of text files"

      Except perhaps the root node of this thread, which said:

      ... a journal program with each entry stored in a txt file with the date as the file's name ...

      I also have no axe to grind either for or against XML. I was merely picking up on the fact that the original question was specifically asking about XML versus plain text and I assumed your reply was too. Sorry for any confusion.