LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-26-2005, 10:26 AM   #1
Ygrex
Member
 
Registered: Nov 2004
Location: Russia (St.Petersburg)
Distribution: Debian
Posts: 666

Rep: Reputation: 68
Is XML universal?


Hello. I am looking for a good data file parser. I want to store a
hierarchical data in it. Also, I suppose that data could be binary.
I need in a fast utility and it must be amongst standard POSIX parsers.

Any suggestions?
 
Old 10-26-2005, 12:11 PM   #2
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Basically, you'd probably want to put base64-encoded data in your XML file the same way you'd add a MIME attachment to an e-mail. For example:

http://ws.apache.org/axis2/mtom-guide.html

.. or ..

http://www.xml.com/pub/a/2003/02/26/binaryxml.html
 
Old 10-26-2005, 02:54 PM   #3
Ygrex
Member
 
Registered: Nov 2004
Location: Russia (St.Petersburg)
Distribution: Debian
Posts: 666

Original Poster
Rep: Reputation: 68
Thank you very much for these documentation. But I do not insist on XML indeed.
I mentioned it only as a variant. I completele do not know XML. It is said XML
is a great thing for such purpose and therefore I remembered it. But I want to
know whether it is really standard lightweight and fast utility or there is
something else? However thank you very much.
 
Old 10-26-2005, 03:03 PM   #4
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
The following is a bit simplistic, but ...

The big advantage of XML would be that you can make the
data self-contained, that is, you have a chance to include
a description of the methods required to use the data with
the data which would make it re-usable in let's say 100 years
from now.

The downside is increased size and a bigger overhead in
handling.

Your call :}


Cheers,
Tink
 
Old 10-26-2005, 03:24 PM   #5
Ygrex
Member
 
Registered: Nov 2004
Location: Russia (St.Petersburg)
Distribution: Debian
Posts: 666

Original Poster
Rep: Reputation: 68
No. The overhead in handling adn size increasing is exactly what I do NOT want
at all. I forgot to say. I want to embed a hierarchical data storage system
into my program written in a very non-object oriented language - C. If XML
requires more high language (like java) it cannot satisfy me. I could write
my own parser but I am sure it exists already and there is no need in my work.
I would like to use a very simple parser with a hierarchical structure, that is
a key word of my searching. I would like to store a very complex data, so
hierarchy is the very thing I need.
 
Old 10-26-2005, 03:32 PM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
When you say hierarchical data, what exactly are you after?
Maybe there are other libraries out there that provide what
you need, and you wouldn't have to reinvent the wheel?


Cheers,
Tink
 
Old 10-26-2005, 03:44 PM   #7
Ygrex
Member
 
Registered: Nov 2004
Location: Russia (St.Petersburg)
Distribution: Debian
Posts: 666

Original Poster
Rep: Reputation: 68
I mean my data could be divided into several sections. Each section must be
able to contain either data itself or another section. I would like to use
data of different types and have a simple way to handle all these data, i.e.
remove/add/modify it. And invention of a wheel is most undesired for me.
Therefore I am here. Please, give me a piece of advise.
 
Old 10-26-2005, 10:22 PM   #8
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

If you want a "standard format" for representing data, XML is a strong contender - even for binary data.

If you want a "standard format" for representing a hierarchy (a hierarchy that happens to contain different kinds of data) - XML is a really, really excellent choice.

If you want cross-platform, cross-language - again, XML is a strong contender.

At the opposite end of the spectrum, you could easily just create your own data format. It'd be a lot simpler to code, and it could yield vastly smaller, more compact files (depending on the size of your binary data items).

There are pros and cons to each choice ... and, unfortunately, there aren't a lot of alternatives in between. Based on what you've said, it sounds like you get to pick between "learn XML" and "roll your own fomat".

Your .. PSM
 
Old 10-27-2005, 03:22 AM   #9
Ygrex
Member
 
Registered: Nov 2004
Location: Russia (St.Petersburg)
Distribution: Debian
Posts: 666

Original Poster
Rep: Reputation: 68
Smile

Thank you, paulsm4.
It seems you ensured me sincerely to use XML. I will learn it.
 
Old 10-27-2005, 03:26 AM   #10
Orkie
Member
 
Registered: Mar 2005
Distribution: Breezy Badger
Posts: 248

Rep: Reputation: 30
The actual XML itself isn't difficult at all - it looks very, very similar to HTML, only it can store data.
The recall of it isn't that hard either - most libraries will place it in a nice structure for you.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
checking for XML::Parser... configure: error: XML::Parser perl module is required for kornerr Linux - General 11 11-16-2008 07:24 AM
Universal Distro programmershous Linux - Distributions 65 07-02-2005 07:37 AM
universal settings tedivm Linux - Newbie 1 08-19-2004 11:20 PM
An Universal clock satimis Linux - Software 3 01-08-2004 06:56 AM
Universal RNG LinuxTiro Programming 0 09-12-2003 11:47 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration