Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: PHP to dynamically generate XML

From: Andy Dingley <dingbat@----------.--->
To: NULL
Date: 7/5/2005 12:19:00 AM
On 4 Jul 2005 12:10:31 -0700, petermichaux@y... wrote:

>I am interested in critisim of how I implemented each method. 

In the second (correct) one you use a DOM and append various elements to
it.

In the first one you generate XML as a string (bad) and then get the DOM
to parse it (super bad).  This is ugly, non-robust and slow.  Don't
duplicate in your application code things that the DOM should be doing.


>For example, one php function queries a database table for a list of CD
>titles. A second php function loops through this CD title list and gets
>the track listing for each CD from another table in the database. 

That's very bad database querying technique. Rather than one query with
a join in it, it's separate queries for the two steps - and the second
step is repeated. If you want long discussions of why this is just so
bad performance-wise, search for "round tripping".



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