使用xml-string-streamer和Codeigniter

Is it possible to use a library such as the xml string streamer ( https://github.com/prewk/xml-string-streamer ) in Codeigniter? It utilises namespaces which Codeigniter doesn't recognise.

I'm currently using:

require_once 'application/libraries/XmlStringStreamer.php';

use application\libraries\XmlStringStreamer;

However, I now get:

Parse error: syntax error, unexpected T_USE

To clarify, I need to request 9 2mb+ sized xml streams, parse them, compare the data in each and output where there are discrepancies as quickly as possible (aiming for ~5 seconds at most). This is my last try, as the structure of the XML files is similar to:

<competition>
 <season>
  <round>
   <match>
    <matchinfo>
     <venue/>
     <referee/>
     <assistant_referee/>
     <assistant_referee/>
     <fourth_official/>
     <attendance/>
     <coach_team_a/>
     <coach_team_b/>
    </matchinfo>
    <lineups/>
    <lineups_bench/>
    <substitutions/>
    <penalty_shootout/>
    <goals/>
    <bookings/>
    <extra/>
   </match>
  </round>
 </season>
</competition>

With upto 600 competition elements in each stream, numerous attributes in each element, and all elements needed except lineups, lineups_bench, substitutions, penalty_shootout, goals, bookings and extra, so if you have any other suggestions that would be helpful. When we were comparing much fewer competitions, I was using XMLReader to pull out and parse the Competition block, then converting each competition element into a SimpleXML object, but with 600 competitions, I need to find a way of reducing how much I'm downloading.

The more I look at it, the more I think this XML isn't fit for the task, so this is my last try before requesting a change to the API generating the XML or I'll try to stream smaller datasets somehow.

Please check your PHP version as if it support the usage of this line :

use application\libraries\XmlStringStreamer;

if not , just upgrade your php version to the latest one. have a nice day :)