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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T12:01:49+00:00 2026-06-18T12:01:49+00:00

I have this code: $strhtml = file_get_contents(‘05001400300320100033100.html’); $dochtml = new DOMDocument(); $dochtml->loadHTML($strhtml); $elm =

  • 0

I have this code:

$strhtml = file_get_contents('05001400300320100033100.html');
$dochtml = new DOMDocument();
 $dochtml->loadHTML($strhtml);
 $elm = $dochtml->getElementById('upPanelActuciones');
 print $dochtml->saveXml($elm);

Im getting this warning:

      Warning: DOMDocument::loadHTML() [domdocument.loadhtml]: error parsing attribute  name in Entity, line: 674 in C:\AppServ\www\video01\sector2\dom3.php on line 10

      Warning: DOMDocument::loadHTML() [domdocument.loadhtml]: Opening and ending tag mismatch: div and td in Entity, line: 1019 in C:\AppServ\www\video01\sector2\dom3.php on line 10

      Warning: DOMDocument::loadHTML() [domdocument.loadhtml]: Opening and ending tag mismatch: div and td in Entity, line: 1020 in C:\AppServ\www\video01\sector2\dom3.php on line 10

      Warning: DOMDocument::loadHTML() [domdocument.loadhtml]: Opening and ending tag mismatch: div and td in Entity, line: 1022 in C:\AppServ\www\video01\sector2\dom3.php on line 10

I can’t manipulate the html (i Know that the html file have errors) so there is a way to remove this warnings? (no show).

Thanks in advance for your 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-18T12:01:50+00:00Added an answer on June 18, 2026 at 12:01 pm

    DOMDocument is very good at dealing with imperfect markup, but it
    throws warnings all over the place when it does.

    This isn’t well documented here. The solution to this is to implement
    a separate aparatus for dealing with just these errors.

    Set libxml_use_internal_errors(true) before calling loadHTML. This
    will prevent errors from bubbling up to your default error handler.
    And you can then get at them (if you desire) using other libxml error
    functions.

    You can find more info here
    http://www.php.net/manual/en/ref.libxml.php

    The correct way to deal with DOMDocument errors is this:

    <?php
    
    // enable user error handling
    var_dump(libxml_use_internal_errors(true));
    
    // load the document
    $doc = new DOMDocument;
    
    if (!$doc->load('file.xml')) {
        foreach (libxml_get_errors() as $error) {
            // handle errors here
        }
    
        libxml_clear_errors();
    }
    
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code : void Main() { System.Timers.Timer t = new System.Timers.Timer (1000);
I have this code: con.Open(); cmd = new MySqlCommand(String.Format(SELECT concat(name,'|',lastname) FROM {0} WHERE ID=
I have this code: class LFSeq: # lazy infinite sequence with new elements from
I have this code: var rect2 = new drawRect({ h: 100, w: 100, x:
I have this code ListItem item=new ListItem(); item.Text=foo; item.Value=1; ListItem item2=new ListItem(); item2.Text=bar; item2.Value=2;
I have this code, it is quite simple but why isn't it working? <html>
I have this code var contacts = dr.mktDoctorContacts .GroupBy(x => x.ContactType) .Select(zb => new
I have this code: XElement EcnAdminConf = new XElement(Type, new XElement(Connections, new XElement(Conn), //
Well, i have this code that is supposed to check if the html is
I have this code: <?php if(!isset($_GET['page']) || $_GET['page'] !== 2){ die(); } ?> <html>

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.