Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8362739
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T12:00:41+00:00 2026-06-09T12:00:41+00:00

I am trying to do something like this using rapidxml using c++ xml_document<> doc;

  • 0

I am trying to do something like this using rapidxml using c++

xml_document<> doc; 
ifstream myfile("map.osm"); 
doc.parse<0>(myfile); 

and receive the following error

Multiple markers at this line – Invalid arguments ‘ Candidates are: void parse(char *) ‘ – Symbol ‘parse’ could not be resolved

file size can be up to a few mega bytes.

please help

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T12:00:42+00:00Added an answer on June 9, 2026 at 12:00 pm

    You have to load the file into a null terminated char buffer first as specified here in the official documentation.

    http://rapidxml.sourceforge.net/manual.html#classrapidxml_1_1xml__document_8338ce6042e7b04d5a42144fb446b69c_18338ce6042e7b04d5a42144fb446b69c

    Just read the contents of your file into a char array and use this array to pass to the xml_document::parse() function.

    If you are using ifstream, you can use something like the following to read the entire file contents to a buffer

     ifstream file ("test.xml");
     if (file.is_open())
     {
        file.seekg(0,ios::end);
        int size = file.tellg();
        file.seekg(0,ios::beg);
    
        char* buffer = new char [size];
    
        file.read (buffer, size);
        file.close();
    
        // your file should now be in the char buffer - 
        // use this to parse your xml     
    
        delete[] buffer;
     }
    

    Please note I have not compiled the above code, just writing it from memory, but this is the rough idea. Look at the documentation for ifstream for exact details. This should help you get started anyway.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to parse a processing instruction like this using StAX: <?item something=<some_element></some_element>?> StAX
I am trying to do something like this, but using @One-To-Many instead of @ElementCollection.
I'm trying to get something like this: http://img202.imageshack.us/img202/552/layoutoy.png . I'm using this as a
I am trying to achieve something like this: while (ifstream has not been entirely
Trying to achieve something like this using recursion: if (m > n) return; Foo
I'm trying to do something like this: using namespace boost::lambda; using boost::thread; int add(int
I'm trying something like this, but this example does not work. jsObj = {};
I'm trying something like this: [ServiceContract ( CallbackContract = typeof (CallbackContract_1), CallbackContract = typeof
Trying to do something like this: select 'Setup for Car ' + CAST(varchar(50), @CarID)
I'm trying to do something like this: public void ImportClick(object sender, EventArgs e) //the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.