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

  • Home
  • SEARCH
  • 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 7904193
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T09:56:51+00:00 2026-06-03T09:56:51+00:00

<element1 type=type1 name=value1> <start play=no/> <element2 aaa=AAA/> <element2 bbb=BBB/> <element3 ccc=CCC> <element4/><!– play=no/>–> </element3>

  • 0
<element1 type="type1" name="value1">
  <start play="no"/>
  <element2 aaa="AAA"/>
  <element2 bbb="BBB"/>
  <element3 ccc="CCC">
     <element4/><!-- play="no"/>-->
  </element3>
</element1>

And I use following code to parse it:

int parse( const char *xml) {

    printf("Entered\n");
    xmlDoc  *doc = NULL;
    doc = xmlReadFile(xml, NULL, 0);

    if (doc == NULL)
        printf("Could not parse file\n");
    else {
        printf("Success\n");
        xmlFreeDoc(doc);
    }

    xmlCleanupParser();
    return 0;
}

But I get following error:

Entered
I/O warning : failed to load external entity "<element1 type="type1" name="value1">
  <start play="no"/>
  <element2 aaa="AAA"/>
  <element2 bbb="BBB"/>
  <element3 ccc="CCC">
     <element4/><!-- play="no"/>-->
  </element3>
</element1>

"
Could not parse file
  • 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-03T09:56:59+00:00Added an answer on June 3, 2026 at 9:56 am

    I believe the first argument to

    xmlReadFile(xml, NULL, 0);
    

    is the name of the file, not the XML string itself. The error message indicates that you passed the actual XML to the method. I believe there is an xmlReadMemory() method that will suit your needs.

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

Sidebar

Related Questions

I have the following XML document named testFix.fix <WriteFixedWidth Type=extract> <Position Start=1 Length=15 Name=Field1
I'm looping through a List of elements with foreach, like this: foreach (Type name
I don't know how to convert the type for name so that each element
I have an input type file element: <input type=file name=val1 /> And jquery: $(input[name='val1']).off(click);
This is where i put a popup box into echo <tr><td>.$set['Name'].</td><td>.$set['Position'].</td><td><select name='aaa'><option value='default'>Not Share</option><option
I have the following in a config.ini file: (Zend_Form_Element) site_status.name = site_status site_status.type =
My code looks something like: template <typename type> void deserialize_element(type* result) { //... if
Where keys are represented by element type and values are represented by #foo and
std::vector<const int> vci; vci.push_back(1); vci[0] = 2; With the element type being const int
I have in my form an input element with type of file. What I

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.