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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T14:09:52+00:00 2026-06-01T14:09:52+00:00

I trying to generate an XML document which is around 23 to 30 MB,

  • 0

I trying to generate an XML document which is around 23 to 30 MB, when i open it with Firefox i receive

XML Parsing Error: not well-formed
Location: file:///Users/User/Downloads/export(2).xml
Line Number 137725, Column 1343:

After that I try to validate the document with XML Nanny and I receive the following error:

Invalid Character (Unicode: 0xB)

On several (13) lines: 137725, 137738, 137751, 137764, 137777, 137790, 137803, 137816, 146834, 189949, 193444, 193457, 193470

I’ve tried several “solutions” which include:

  1. Regular Expression:

    preg_replace(
      '/[^\x9\xA\xD\x20-\x{D7FF}\x{E000}-\x{FFFD}\x{10000}-\x{10FFFF}]+/'
      , ' ', $data->Description);
    

    The problem here is that I’am not quite sure that this is valid RegEx, because I receive Internal Server Error because of enabled mod security in our apache.

  2. I’ve tried to save my file in UTF-8 with BOM, but that was desperate trying

  3. I’ve tried to use iconv with ‘UTF-8//IGNORE’ but and this didn’t help

  4. I’ve tried to use character by character replacement, but this didn’t work well with my file because i have 230k lines.. even if i replace the specific tag in which i have that problem i’ve trigger max_execution_time directive in php and my script is killed.

For now my solution is to clear database records of this invalid characters manually, but this is now proper and correct solution to my problem because in future this script will be used to automate this export and manual editing isn’t option or subject of speech.

  • 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-01T14:09:53+00:00Added an answer on June 1, 2026 at 2:09 pm

    I’d first of all stick to the information given by XML Nanny:

    Invalid Character (Unicode: 0xB) (several lines)
    

    0xB is a character from the control character range, but only very limited control characters are allowed in a XML document. I suggest you start replacing those with numerical entities and try again:

    $xml = strtr($xml, array("\x0B" => ""));
    

    Firefox might accept those.

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

Sidebar

Related Questions

I am trying to generate a dynamic xml document in CakePHP to output to
I'm trying to generate a XML document from the SQL Server 2005 database by
I am trying to generate an xml document in a specific format. I would
I'm trying to generate an XML document using a class generated by the xsd.exe
I am trying to generate an XML document using the XML features in SQL
I have an xml document (generated from msword 2010), which I am trying to
I'm trying to generate customized xml files from a template xml file in python.
I am trying to generate an xml file of a recipe database that has
I'm trying to generate a sitemap.xml on the fly for a particular asp.net website.
I'm trying to generate a RDoc using the XML format. Here's the command that

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.