Boost logo

Boost :

From: Oliver.Kowalke_at_[hidden]
Date: 2007-05-08 06:47:44


Hello,
I get an exception if I write an empty ptree to a stringstream and try
to reconstruct a ptree from this stringstream.

   <unspecified file>(2): xml parse error

test code:

int main( int argc, char *argv[])
{
        try
        {
                std::stringstream ss;
                {
                        pt::ptree p;
                        pt::write_xml( ss, p);
                }
                std::cout << ss.str() << std::endl;
                {
                        pt::ptree p;
                        pt::read_xml( ss, p); // throws exception
                }
                return EXIT_SUCCESS;
        }
        catch ( std::exception const& e)
        { std::cerr << e.what() << std::endl; }
        catch ( ... )
        { std::cerr << "unhandled exception" << std::endl; }
        return EXIT_FAILURE;
}


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk