Newibe C++ XML Questions

Discussion in 'C++' started by BCC, Feb 21, 2005.

  1. BCC

    BCC Guest

    Hi,

    I have a small app that needs to read in an xml file that I create, and then
    initialize some variable and objects with the data in the file.

    Ive taken a look around and still cant decide which way I should go for c++
    in VC7.

    I downloaded and installed xerces, and holy crappola, there is waaaaay too
    much information there for me to sort out what I need. Between the DOM,
    event driven SAX1, SAX2, I have really no clue where to go.

    I managed to use SAX2 to read in my xml document, but I cant find any
    documentation anywhere that tells me how to extract the info I need from the
    xml and use it. All the sample apps from the xerces site either read in a
    file or just write one out... I dont see where they read one in and suck out
    the data within the file. Very frustrating.

    Is xerces really the best way to go?? Seems like way overkill for what I
    want to do, and quite simply, I cant figure out how to use it. .NET has its
    own xml parser, but I dont want to use managed C++.

    Do I want to use DOM or SAX? Are there other smaller utilities that will
    get me to where I want to go?

    Any suggestions are appreciated.

    Bryan
    BCC, Feb 21, 2005
    #1
    1. Advertising

  2. BCC wrote:

    > Hi,
    >
    > I have a small app that needs to read in an xml file that I create, and then
    > initialize some variable and objects with the data in the file.
    >
    > Ive taken a look around and still cant decide which way I should go for c++
    > in VC7.
    >
    > I downloaded and installed xerces, and holy crappola, there is waaaaay too
    > much information there for me to sort out what I need. Between the DOM,
    > event driven SAX1, SAX2, I have really no clue where to go.
    >
    > I managed to use SAX2 to read in my xml document, but I cant find any
    > documentation anywhere that tells me how to extract the info I need from the
    > xml and use it. All the sample apps from the xerces site either read in a
    > file or just write one out... I dont see where they read one in and suck out
    > the data within the file. Very frustrating.
    >
    > Is xerces really the best way to go?? Seems like way overkill for what I
    > want to do, and quite simply, I cant figure out how to use it. .NET has its
    > own xml parser, but I dont want to use managed C++.
    >
    > Do I want to use DOM or SAX? Are there other smaller utilities that will
    > get me to where I want to go?



    This is off topic in clc++, regarding vc++ you should ask in
    microsoft.public.dotnet.languages.vc.


    If it doesn't appear in your news server use the public MS newserver:

    msnews.microsoft.com


    That said, .NET provides full XML support of its own.


    Check

    http://msdn.microsoft.com/library/d...uide/html/cpconemployingxmlinnetframework.asp


    and especially the classes XmlTextReader, XmlTextWriter (forward only
    parsing), XmlReader, XmlWriter, XmlDocument (in memory DOM
    representation of an XML document), XPath, for queries and others.


    Probably you will have to read a book or something. There are
    specialised .NET books for XML, that you may read.




    --
    Ioannis Vranos

    http://www23.brinkster.com/noicys
    Ioannis Vranos, Feb 21, 2005
    #2
    1. Advertising

  3. BCC

    Phil Staite Guest

    "plain" XML just for saving some structured/tagged config info is fairly
    simple. Consider writing your own simple parser. The GOF "Composite"
    pattern works very well for this.

    For some of these full-featured XML parsers out there writing your own
    is no more difficult than climbing their learning curve. BTDT.
    Phil Staite, Feb 21, 2005
    #3
    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. Karl Bedingfield
    Replies:
    0
    Views:
    370
    Karl Bedingfield
    Aug 13, 2003
  2. BCC
    Replies:
    2
    Views:
    545
    Martin Honnen
    Feb 21, 2005
  3. HL
    Replies:
    2
    Views:
    403
  4. Arvin Portlock
    Replies:
    0
    Views:
    139
    Arvin Portlock
    Jun 20, 2005
  5. Erik Wasser
    Replies:
    5
    Views:
    437
    Peter J. Holzer
    Mar 5, 2006
Loading...

Share This Page