CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
XML Parsing

 



mwalstra
Novice

May 13, 2009, 6:24 AM

Post #1 of 4 (315 views)
XML Parsing Can't Post

Hi there,

At the moment i am sending a large XML file (+- 10 MB) and it is taking over 30 minutes to process using XML::Parser

I am not using Twig as my xml structure is only about 10 elements, its just the one element is base 64 data of a document.

I need to know how to get the processing of this large data to occur quicker.

Does anyone have any ideas?


FishMonger
Veteran / Moderator

May 13, 2009, 6:26 AM

Post #2 of 4 (314 views)
Re: [mwalstra] XML Parsing [In reply to] Can't Post

You need to post your code.


mwalstra
Novice

May 13, 2009, 6:37 AM

Post #3 of 4 (311 views)
Re: [FishMonger] XML Parsing [In reply to] Can't Post


Code
if(length($receivedXML)>500) 
{
$ENV{XML_SIMPLE_PREFERRED_PARSER} = "XML::Parser";
}
else
{
$ENV{XML_SIMPLE_PREFERRED_PARSER} = "XML::LibXML::SAX";
}$receivedHash = XMLin($receivedXML,SuppressEmpty => undef);Code$faxFile = $receivedHash->{fax_file};
$faxFileName = $FileToSendPath . $faxJobReference . ".tif";
$decodedValue = decode_base64($faxFile);
open (FH, "> $faxFileName") || die print "Cant open job $faxFileName";
print FH $decodedValue;
close FH; #XML POSTED ACROSS$xml = "<?xml version=\"1.0\"?><pc2fax_api><function>entrust_fax_job</function><api_session_id>$session_id</api_session_id><fax_job_reference>".substr($file,rindex($file,"/")+1)."_"."$time</fax_job_reference><fax_date_time></fax_date_time><notification_address>$email</notification_address><fax_file>$Base64Data</fax_file></pc2fax_api>";





Basically the above is just code snippets but it gives the idea?


FishMonger
Veteran / Moderator

May 13, 2009, 7:47 AM

Post #4 of 4 (306 views)
Re: [mwalstra] XML Parsing [In reply to] Can't Post

Based on what you posted, it's impossible to say what you need to change.

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives