XML Alternatives

Discussion in 'C++' started by charles.debon@yahoo.com, Feb 12, 2008.

  1. Guest

    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.
     
    , Feb 12, 2008
    #1
    1. Advertising

  2. Lars Uffmann Guest

    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
     
    Lars Uffmann, Feb 12, 2008
    #2
    1. Advertising

  3. James Kanze Guest

    On Feb 12, 9:54 am, Lars Uffmann <> wrote:
    > 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:
    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
     
    James Kanze, Feb 12, 2008
    #3
  4. Lars Uffmann Guest

    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
     
    Lars Uffmann, Feb 12, 2008
    #4
  5. Guest

    > 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
    - ...
     
    , Feb 12, 2008
    #5
  6. Lars Uffmann Guest

    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
     
    Lars Uffmann, Feb 12, 2008
    #6
  7. Rainer Lehrig, Feb 12, 2008
    #7
  8. James Kanze Guest

    On Feb 12, 12:55 pm, Lars Uffmann <> 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:
    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
     
    James Kanze, Feb 12, 2008
    #8
  9. Lars Uffmann Guest

    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
     
    Lars Uffmann, Feb 13, 2008
    #9
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Robert V. Hanson
    Replies:
    2
    Views:
    671
    Yan-Hong Huang[MSFT]
    Jul 3, 2003
  2. daz_oldham
    Replies:
    18
    Views:
    12,585
    spiff
    Jul 12, 2006
  3. Jon
    Replies:
    3
    Views:
    430
    Pavel Lepin
    Feb 5, 2008
  4. XML Alternatives

    , Feb 11, 2008, in forum: XML
    Replies:
    9
    Views:
    828
  5. Erik Wasser
    Replies:
    5
    Views:
    465
    Peter J. Holzer
    Mar 5, 2006
Loading...

Share This Page