Uploaded image for project: 'translate5'
  1. translate5
  2. TRANSLATE-602

Huge transit files are leading to: DOMDocument::loadXML(): internal error: Huge input lookup in Entity

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • None
    • None
    • Import/Export

    Description

      Huge transit files are producing the following error:
      DOMDocument::loadXML(): internal error: Huge input lookup in Entity. This message comes from the underlying LibXML.

      The error output will improved in this case, so that the affected filename will be logged.
      As solution found so far:

      Always remember that with the default parameters this function doesn't handle well large files, i.e. if a text node is longer than 10Mb it can raise an exception stating:

      DOMDocument::loadXML(): internal error Extra content at the end of the document in Entity

      even though the XML is fine.

      The cause is a definition in parserInternals.h of lixml:
      #define XML_MAX_TEXT_LENGTH 10000000

      To allow the function to process larger files, pass the LIBXML_PARSEHUGE as an option and it will work just fine:

      $domDocument->loadXML($xml, LIBXML_PARSEHUGE);

      from: http://php.net/manual/en/domdocument.loadxml.php#113676

      Attachments

        Issue Links

          Activity

            People

              tlauria Thomas Lauria
              beo beo IT
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: