Altova Mailing List Archives

Re: How to get PHP to Order by Day of Month when processing an XML file Options

From: Pavel Lepin <p.lepin@-------.--->
Date: 7/30/2007 12:32:00 PM

Phill.Booth@g... <Phill.Booth@g...>
wrote in
> Hello I need to get PHP to order the output of the XML
> file to be ACENDING to the numerical value of the XML
> <start_day></start_day> tags
> <?php
>  function makexmltree($getmonth) {

Oh great. At least there's no BOM.

>          $product_codes = $book-
>>getElementsByTagName( "product_code" );



> makexmltree("July");
> ?>
> XML File (trimed down)
> <dataroot>
> <event><product_no>10790</product_no>
> <product_code>GBMBL6295E</product_code>
> <product_name>Gwen Stefani</product_name>
> <running_period_of_event>
> <start_day>25</start_day>
> <start_month>September</start_month>
> <start_year>2007</start_year>
> <end_day>25</end_day>
> <end_month>September</end_month>
> <end_year>2007</end_year>
> </running_period_of_event>
> <event_venue>The nia academy</event_venue>
> </event>
> <event>
> <product_no>3027</product_no>
> <product_code>GBMBL0329E</product_code>
> <product_name>Berlioz Restaurant</product_name>
> <running_period_of_event>
> <start_day>10</start_day>
> <start_month>May</start_month>
> <start_year>2006</start_year>
> <end_day>10</end_day>
> <end_month>May</end_month>
> <end_year>2010</end_year>
> </running_period_of_event>
> <event_venue></event_venue>
> </event>
> </dataroot>

Right. Where's the friggin' July? Sorting just one item
simply ain't all that useful either.

Anyway, after spending twenty minutes on getting your code
to work (I got wondering just how messed-up an online
request for help may get... boy, wasn't I surprised), I
have two recommendations for you:

1. Quit now. End your suffering. More importantly, end your
co-workers' suffering. With your lack of mental discipline
and common sense you're not going to do much good, but you
have the potential for causing an awful lot of harm.

2. Barring that, look up usort() in the friggin' PHP Manual.
(Right, it was under your nose all along - does that feel


...the pleasure of obedience is pretty thin compared with
the pleasure of hearing a rotten tomato hit someone in the
rear end. -- Garrison Keillor


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 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.