Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: PHP 5, XSL transformations of big files

From: Meglio <x.meglio@-----.--->
To: NULL
Date: 5/4/2008 4:52:00 AM
On May 4, 11:24 am, "Joe Fawcett" <joefawc...@newsgroup.nospam> wrote:
> "Meglio" <x.meg...@gmail.com> wrote in message
>
> news:8d76aeb6-9196-45c5-a557-a400fe161d19@m......
>
> > On May 3, 9:24 pm, "Neil Smith [MVP Digital Media]" <n...@nospam.com>
> > wrote:
> >> Time exceeded when uploading file content is usually related to the
> >> client upload time required to get the content onto the server - PHP5
> >> uses Libxml for processing and XSL work, which is very fast.
>
> >> You should check not only the max_execution_time, but also the php.ini
> >> setting for max_input_time, which refers to the upload duration
> >> :http://uk.php.net/manual/en/info.configuration.php#ini.max-input-time
>
> >> Those settings are distinct, separate timeouts.
>
> >> Note that if you're using the XSL extension then you're working with
> >> DOM which creates the structure in memory - make sure you have enough
> >> memory allocated to PHP to process the nodes in a 20MB input document.
>
> >> Another approach would be just to accept the file upload, flag the
> >> file content as a DB record "to process" and do the processing out of
> >> band as a scheduled task / cron job on a beefier backend server.
>
> >> HTH
> >> Cheers - Neil
>
> >> On Sat, 3 May 2008 02:57:46 -0700 (PDT), Meglio <x.meg...@gmail.com>
> >> wrote:
>
> >> >Hi.
>
> >> >I'm going to make in auto some tasks that I'm doing manually every
> >> >day. I'm uploading big XML file (~20mb) and then I'm using XSLT schema
> >> >to transform it to MySQL queries file.
>
> >> >I have used 3rd tools to process XSLT and it takes few seconds to
> >> >process my big XML file.
>
> >> >But now I'm moving to PHP so I'm trying to use XSL PHP extension to
> >> >apply my XSL file. But... it takes minutes... I allowed 10 minutes
> >> >( set_time_limit(600) ) and it still crashes and says that time
> >> >excited.
>
> >> >So please somebody help me to find a way out of the impasse. I can't
> >> >move forward now because of slow XSL processing.
>
> >> >The code I'm using is:
>
> >> >*******
> >> >// Load the XML source
> >> >$xml = new DOMDocument;
> >> >$xml->load('extracted/marketplace_feed_v1.xml');
>
> >> >$xsl = new DOMDocument;
> >> >$xsl->load('cb_marketplace_feed_compact.xsl');
>
> >> >// Configure the transformer
> >> >$proc = new XSLTProcessor;
> >> >$proc->importStyleSheet($xsl); // attach the xsl rules
>
> >> >$sqlCommands = $proc->transformToXML($xml);
> >> >if ($sqlCommands == FALSE)
> >> >{
> >> >        echo "XSLT transformation failed";
> >> >        exit;
>
> >> >}
>
> >> >if (file_put_contents('cbfeed.sql', $sqlCommands) == FALSE);
> >> >{
> >> >        echo 'Failed to save XSLT transformation result to the file
> >> >"cbfeed.sql"';
> >> >        exit;
>
> >> >}
>
> >> >*******
>
> >> >You can upload files used in my script here:
>
> >> >http://megliosoft.org/meglio/cbfeed/marketplace_feed_v1.xml
> >> >http://megliosoft.org/meglio/cbfeed/cb_marketplace_feed_compact.xsl
>
> >> >Any information may help.
>
> >> >Thanks,
> >> >Anton
>
> >> ------------------------------------------------
> >> Digital Media MVP : 2004-2008http://mvp.support.microsoft.com/mvpfaqs
>
> > No problem with time execution, no problem with memory limits. The
> > problem is script execution time - it do not completed even in 10
> > minutes.
>
> > Anton
>
> You had three quick responses yet seem to have picked on the one that least
> suited you, did any of the other suggestions help?
>
> --
>
> Joe Fawcett (MVP - XML)http://joe.fawcett.name

No. I do not know how to move forward to solve this problem.


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent