Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > XML Alternatives

Reply
Thread Tools

XML Alternatives

 
 
charles.debon@yahoo.com
Guest
Posts: n/a
 
      02-12-2008
XML was designed for text documents and publishing. If you are
considering XML for general data (serialization, configuration etc.) I
would like to invite you to a page about xml alternatives:

http://www.geocities.com/charles.debon/

Any comments are invited.
 
Reply With Quote
 
 
 
 
Lars Uffmann
Guest
Posts: n/a
 
      02-12-2008
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> XML was designed for text documents and publishing. If you are
> considering XML for general data (serialization, configuration etc.)


I just had a short look and already gave up after 2 minutes: I've never
heard about any of the linked formats before, and I want others to be
able to read my data. I am about to store configuration data in xml
format, and I will do so because I think the best configuration data
storage format is plain-text readible, which is the case for xml. At
least whenever it makes sense that users can have a look at
configuration files and maybe modify them by hand.

Sorry that I am not willing to have a deeper look right now for better
feedback, just my 2c...

Lars
 
Reply With Quote
 
 
 
 
James Kanze
Guest
Posts: n/a
 
      02-12-2008
On Feb 12, 9:54 am, Lars Uffmann <(E-Mail Removed)> wrote:
> (E-Mail Removed) wrote:
> > XML was designed for text documents and publishing. If you are
> > considering XML for general data (serialization, configuration etc.)


> I just had a short look and already gave up after 2 minutes: I've never
> heard about any of the linked formats before, and I want others to be
> able to read my data. I am about to store configuration data in xml
> format, and I will do so because I think the best configuration data
> storage format is plain-text readible, which is the case for xml. At
> least whenever it makes sense that users can have a look at
> configuration files and maybe modify them by hand.


Many different formats are plain-text, and for simpler data, XML
is definitely overkill, and more difficult for both human readers
and the program than some other formats. For a lot of
configuration files, the Microsoft .ini format is fine, or even
just simple attribute value pairs (e.g. the format in each
section of a Microsoft .ini format).

Once you have a more structured format, of course, you probably
want to use XML, if for no other reason than that it is
standard. But be aware that while human readable, it isn't
easily human readable, and that it requires a lot more resources
than some simpler formats.

--
James Kanze (GABI Software) email:(E-Mail Removed)
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
 
Reply With Quote
 
Lars Uffmann
Guest
Posts: n/a
 
      02-12-2008
James Kanze wrote:
> Once you have a more structured format, of course, you probably
> want to use XML, if for no other reason than that it is
> standard. But be aware that while human readable, it isn't
> easily human readable, and that it requires a lot more resources
> than some simpler formats.


What I liked about XML in the past is the automatic validation by (ASP &
PHP) opening with domxml - once there was no error upon opening the
file, I could assume that the XML validated correctly

Don't know about ini-files, but they seem so simple that I'd have to
create the code to read out the parameters myself... Otherwise those
would be an option I guess.

Thanks anyways!

Lars
 
Reply With Quote
 
charles.debon@yahoo.com
Guest
Posts: n/a
 
      02-12-2008
> I am about to store configuration data in xml
> format, and I will do so because I think the best configuration data
> storage format is plain-text readible, which is the case for xml.


All presented formats are "plain-text readible".

I just want you to consider for a moment that XML, although
being definetely most popular, is no necessarily the best
in terms such as:
- ease of writing
- semantical compatibility with programming languages
- clarity of data modelling rules
- conciseness
- ...
 
Reply With Quote
 
Lars Uffmann
Guest
Posts: n/a
 
      02-12-2008
(E-Mail Removed) wrote:
> I just want you to consider for a moment that XML, although
> being definitely most popular, is no necessarily the best
> in terms such as:
> - ease of writing
> - semantical compatibility with programming languages
> - clarity of data modelling rules
> - conciseness
> - ...


Am aware of it, but it has served me perfectly well for creating
templates for dynamic websites - in case of a php/apache database
application. I was able to put regular xhtml in xml files, add my own
attributes (such as:
<table datasource="accessRestrictions" orderBy="accesslevelRead DESC,
accesslevelWrite DESC, area" style="text-align:left">
<fielddef f1="id" f2="type" f3="area" f4="name" f5="accesslevelRead"
f6="accesslevelWrite" />
<tr>
<th>Area</th>
<!-- more headings... -->
</tr>
<tr rowType="datarow">
<td><PHP returnValue="getTextInput ('area$id$', '$area$',
'Berechtigungen')" /></td>
<!-- more data columns -->
</tr>
</table>
) - then easily treat my "homemade" attributes in php, fill the
appropriate xml nodes with data (like repeat datarow for each recordset,
filling in data for the placeholders $fieldname$) and output the
resulting xhtml bytestream to the client browser.

I first created that with domxml and Active Server Pages, about 2001,
and then migrated the thing to PHP (to learn php and get a job done) -
and it became a powerful tool for easy webbased data access. And if I am
able to use one format (XML) without a single drawback, then I don't see
why I should use a different one

Of course, for simple option files, this might be an overkill, but since
I might be needing protocol definitions later on, I would like to use
"one for all".

Best Regards,

Lars

PS: F'Up to comp.programming
 
Reply With Quote
 
Rainer Lehrig
Guest
Posts: n/a
 
      02-12-2008
For INI files that humans may edit,
we also use th MS format.

http://pvbrowser.de/pvbrowser/sf/man...rlIniFile.html


 
Reply With Quote
 
James Kanze
Guest
Posts: n/a
 
      02-12-2008
On Feb 12, 12:55 pm, Lars Uffmann <(E-Mail Removed)> wrote:
> James Kanze wrote:
> > Once you have a more structured format, of course, you probably
> > want to use XML, if for no other reason than that it is
> > standard. But be aware that while human readable, it isn't
> > easily human readable, and that it requires a lot more resources
> > than some simpler formats.


> What I liked about XML in the past is the automatic validation
> by (ASP & PHP) opening with domxml - once there was no error
> upon opening the file, I could assume that the XML validated
> correctly


What's nice about XML is that much of the work has already been
done, yes. (Although I'd be surprised if you couldn't find a
library for the MS .ini format as well---or just about any
format used by an Open Source project somewhere.)

> Don't know about ini-files, but they seem so simple that I'd
> have to create the code to read out the parameters myself...
> Otherwise those would be an option I guess.


They're a lot easier for a human to read and modify that XML is.
That's a big advantage. The code to parse them is also
significantly smaller than that necessary to parse XML---in some
cases, that can also be an advantage.

In practice, of course, you'll already have the tools handy
which will allow parsing them in just a couple of lines of code.
(My parser took about 10 lines of new code, IIRC.)

--
James Kanze (GABI Software) email:(E-Mail Removed)
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
 
Reply With Quote
 
Lars Uffmann
Guest
Posts: n/a
 
      02-13-2008
F'Up set to comp.programming

James Kanze wrote:
> What's nice about XML is that much of the work has already been
> done, yes. (Although I'd be surprised if you couldn't find a
> library for the MS .ini format as well---or just about any
> format used by an Open Source project somewhere.)


Ya, but have to find it first As long as the combination of
wxWidgets, sockets & boost library (though the latter only to a
fraction) inflate the size of my executable to about 2.7MBytes, the few
extra kbytes for xerces-c domxml support don't matter THAT much

And I'm familiar with domxml programming.

> In practice, of course, you'll already have the tools handy
> which will allow parsing them in just a couple of lines of code.


Na, for ini-files I don't - is there something anyone knows off the top
of their head that let's me inifile.getAttributeByName("windowWidth")?
Regardsless of the order in the file?

Thanks & Best Regards,

Lars


 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
BGP alternatives? SP Cisco 3 09-08-2009 02:32 AM
XML Alternatives charles.debon@yahoo.com XML 9 02-14-2008 02:00 PM
Alternatives to xml-stylesheet procssing instructions Jon XML 3 02-05-2008 12:02 PM
Is XML Spy good - and are there cheaper alternatives? daz_oldham XML 18 07-12-2006 10:07 AM
Different results parsing a XML file with XML::Simple (XML::Sax vs. XML::Parser) Erik Wasser Perl Misc 5 03-05-2006 10:09 PM



Advertisments