XML parsing problem - HTML entity characters in XML

Author - Webner

Problem

We had written a PHP program to parse large XML files and split each file into smaller chunks. Program was working fine for all the XML files except few. It was not splitting some XML files. After looking for the issue we found that ampersand character (&) was used in those XML files which parser was unable to split.

Solution
To solve this problem one solution is to use PHP function htmlspecialchars($str); to convert special characters contained in each value to equivalent html entity like & to &, < to <, > to > and so on.

The other solution is to replace special char manually in text editor.

Webner Solutions is a Software Development company focused on developing CRM apps (Salesforce, Zoho), LMS Apps (Moodle/Totara), Websites and Mobile apps. If you need Web development or any other software development assistance please contact us at webdevelopment@webners.com

Webner Solutions is a Software Development company focused on developing Insurance Agency Management Systems, Learning Management Systems and Salesforce apps. Contact us at dev@webners.com for your Insurance, eLearning and Salesforce applications.

Leave a Reply

Your email address will not be published. Required fields are marked *