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 7400919
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T04:19:41+00:00 2026-05-29T04:19:41+00:00

I have a huge XML file (114 KB/1719 lines; see the error message below

  • 0

I have a huge XML file (114 KB/1719 lines; see the error message below why I say huge) and I try to read it as I have done with two similar files before.

The other two files load normally and are of comparable size the only difference being that the file in question contains Arabic text. So here is the PHP code:

$doc3 = new DOMDocument('1.0', 'utf-8');
$doc3->load($masternumber.'.xml');

And the error is:

Warning: DOMDocument::load() [domdocument.load]: Excessive depth in document: 256 use XML_PARSE_HUGE option in file: …

Then $doc3 doesn’t load the file. So I modified the code:

$doc3->load($masternumber.'.xml', "LIBXML_PARSEHUGE");

And I end-up with another warrning:

Warning: DOMDocument::load() expects parameter 2 to be long, string given in…

$doc3 is empty again.

What is wrong with it? The other files contain the same text in other languages and load properly but not this one? I am using PHP 5.3.9.

  • 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-05-29T04:19:41+00:00Added an answer on May 29, 2026 at 4:19 am

    Use a constant, not a string.

    $doc3->load($masternumber.'.xml', LIBXML_PARSEHUGE);
    

    See the DOMDocument::load() documentation for complete details. The second parameter is a long integer representing the selected options from the list of constants.

    Incidentally, if you need multiple options for any reason, it is done by combining them with the bitwise OR operator |

    // Multiple options  OR'd together...
    // Just FYI, not specific to your situation...
    $doc3->load($masternumber.'.xml', LIBXML_PARSEHUGE|LIBXML_NSCLEAN);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple but huge xml file like below. I want to parse
I have to read a huge xml file which consists of over 3 million
So I have this huge XML file that I am converting to an object
As the title says it, I have a huge xml file (GBs) <root> <keep>
I have this very huge XML file of size 2.8GB. This is Polish Wikipedia's
I have got a huge xml file (~ 85 Mo) and I would like
I have a huge xml file and i want to convert it to a
I have a huge xml file that I would like to split up into
I have a huge XML file of 9 GB where i need to add
I have a huge xml file (1 Gig). I want to move some of

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.