FutureQuest, Inc. FutureQuest, Inc. FutureQuest, Inc.

FutureQuest, Inc.
Go Back   FutureQuest Community > General Site Owner Support (All may read/respond) > General Coding/Development
User Name
Password  Lost PW

Reply
 
Thread Tools Search this Thread Display Modes
Old 06-21-2022, 06:36 PM   Postid: 188751
Javier Mosqueda
Site Owner
 
Javier Mosqueda's Avatar

Forum Notability:
26 pts: User-friendly
[Post Feedback]
 
Join Date: Dec 1998
Location: Queretaro Mexico
Posts: 162
xmlproc

Hi Friends, Greetings!!

I was improving the processing time of a php code and I found that this pair of routines were devouring a lot of time

/* @$xt->importStyleSheet(DomDocument::Load($ss));
$cadena=$xt->transformToXML(DomDocument::Load("\{$this->rutax\} \{$xml}-timbrar.xml"));*/

I replaced this with an old but rather good tool mentioned on subject

$cadena=`xsltproc '{$ss}' '{$this->rutax\}\{$xml}-timbrar.xml'`;

$result=`xsltproc 'template.xslt' 'file.xml'`

EXPLANATION

xsltproc uses a template (xslt or xsl) and processes the xml to form a pipe-connected chain of values extracted from the XML, with double pipe at start and end of the chain as the result of the process.

The class used in PHP that I commented, /* --- too long time */ was taking nearly 30 seconds while the xsltproc only 3 to 6 seconds still not so quick but much better that the above class, because the xsl or xslt file serving as template, makes references to remote servers.

QUESTIONS

1.- I've enjoyed the xslt for 11 years and its invaluable, willl you maintain those tools?
xsltproc -V (my local xsltproc)
Using libxml 20904, libxslt 10128 and libexslt 817
xsltproc was compiled against libxml 20904, libxslt 10128 and libexslt 817
libxslt 10128 was compiled against libxml 20904
libexslt 817 was compiled against libxml 20904

[myself@FQ-MyServer:~ ]$ xsltproc -V
Using libxml 20901, libxslt 10128 and libexslt 817
xsltproc was compiled against libxml 20901, libxslt 10128 and libexslt 817
libxslt 10128 was compiled against libxml 20901
libexslt 817 was compiled against libxml 20901

Both seem similar though the last line at MyServer seems perhaps a bit older?

Thanks!

2.- If I wanted to do local processing without maknig remote http references...,could I just replace the references at the INCLUDE shown below? I will let you know which times are obtained. Thanks!!!
__________________
Javier Mosqueda
Javier Mosqueda is offline   Reply With Quote
Old 06-22-2022, 12:34 AM   Postid: 188752
Javier Mosqueda
Site Owner
 
Javier Mosqueda's Avatar

Forum Notability:
26 pts: User-friendly
[Post Feedback]
 
Join Date: Dec 1998
Location: Queretaro Mexico
Posts: 162
Re: xmlproc

Update: reduction of processing time , from 1.7 downtown 0.03 seconds , being respectively when xslt had original http include references at remote servers and later when xslt was updated with local references and the remote xslt files were cURL-ed to be stored locally.
__________________
Javier Mosqueda
Javier Mosqueda is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 visitors)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 12:22 AM.


Running on vBulletin®
Copyright © 2000 - 2019, Jelsoft Enterprises Ltd.
Hosted & Administrated by FutureQuest, Inc.
Images & content copyright © 1998-2019 FutureQuest, Inc.
FutureQuest, Inc.