how to parse an xml message in std::string (C++) using xerces sax2

Discussion in 'XML' started by muralibala68@gmail.com, Sep 6, 2007.

  1. Guest

    Hi,

    How do I parse an xml message that is in std::string using sax2 parse
    method that does not seem to take a string and expects a filename?

    Thanks.
     
    , Sep 6, 2007
    #1
    1. Advertising

  2. Pavel Lepin Guest

    < > wrote in
    <>:
    > How do I parse an xml message that is in std::string using
    > sax2 parse method that does not seem to take a string and
    > expects a filename?


    The API reference seems to indicate you'd have to construct
    a MemBufInputSource from your std::string (statically cast
    a pointer to the first character to XMLByte*), then supply
    the resulting object as a parameter to the overloaded
    parse() member function.

    --
    This chickenus crossed the roadus while yodelingus.
     
    Pavel Lepin, Sep 6, 2007
    #2
    1. Advertising

  3. Guest


    > The API reference seems to indicate you'd have to construct
    > a MemBufInputSource from your std::string (statically cast
    > a pointer to the first character to XMLByte*), then supply
    > the resulting object as a parameter to the overloaded
    > parse() member function.
    >


    Thanks Pavel. It works now. Found some more useful info in
    MemParse.cpp from 'samples' too.

    Cheers.
     
    , Sep 6, 2007
    #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. Per Magnus L?vold
    Replies:
    0
    Views:
    2,081
    Per Magnus L?vold
    Nov 16, 2004
  2. Watsh
    Replies:
    2
    Views:
    1,010
    Keith M. Corbett
    Nov 2, 2004
  3. Replies:
    2
    Views:
    3,482
  4. Jeffrey Walton
    Replies:
    10
    Views:
    975
    Mathias Gaunard
    Nov 26, 2006
  5. Jeff Higgins
    Replies:
    1
    Views:
    323
    Jeff Higgins
    Jun 24, 2012
Loading...

Share This Page