Re: [PHP-XML-DEV] XSLTProcessor issue

[email protected] (Rob Richards) Mon, 22 Mar 2010 11:01:31 -0400
Newsgroups php.xml.dev
Message-ID <[email protected]>
Tom wrote:
> I have located what appears to me to be bug in the XSLTProcessor in 
> PHP5.2.13 but want to insure that I am not overlooking something before 
> reporting it. Any advice will be appreciated.
>
>
>
> The issue is apparent discrepancies in output sort order in an XSLTProcessor 
> generated list. Following is a detailed description.
>
>
>
> Scenario: Disk resident xml file with a top level "Places" element and a 
> list of subordinate "Place" elements. Each "Place" element has a "fullName" 
> attribute with self explanatory value. Place heirarchy is indicated by comma 
> separated fields in the attribute value, e.g. Accomac Co., Virginia, USA. 
> Also, a disk resident xsl file whose purpose is to transform the xml file 
> into a html file with the "Place" element collection sorted and rewritten as 
> a list of full place names. When the xsl translation is invoked by assigning 
> the xsl to the xml file and accessing the xml file in IE8, the displayed 
> output appears exactly as expected, e.g.
>
>
>
> Accomack Co., VA, USA
>
> Adams Co., PA, USA
>
> Ahoskie Twp., Hertford Co., NC, USA
>
> Ahoskie, Hertford Co., NC, USA
>
> AK, USA
>
> AL, USA
>
> Alachua Co., FL, USA
>
> Alamance Co., NC, USA
>
> Alameda Co., CA, USA
>
> Alameda, Alameda Co., CA, USA
>
>
>
> However, when invoked via the following php script, using PHP5.2.13 -
>
>
>
> $xml = new DOMDocument();
> $xml->load("F:\Places.xml");
>
> $xsl = new DOMDocument();
> $xsl->load("F:\Places.xsl");
>
> $xslt = new XSLTProcessor();
> $xslt->importStylesheet($xsl);
> echo $xslt1->transformToXML($xml);
>
>
>
> some sort order discrepancies appear in the output, e.g.
>
>
>
> AK, USA
>
> AL, USA
>
> Accomack Co., VA, USA
>
> Adams Co., PA, USA
>
> Ahoskie Twp., Hertford Co., NC, USA
>
> Ahoskie, Hertford Co., NC, USA
>
> Alachua Co., FL, USA
>
> Alamance Co., NC, USA
>
> Alameda Co., CA, USA
>
> Alameda, Alameda Co., CA, USA
>
>
>
> Note that the state records, which have upper case second character, 
> incorrectly appear ahead of other places. This behavior appears even if the 
> "case-order='lower-first'" attribute is included in the <xsl:sort> element 
> in the xsl stylesheet.
>
>
>
> Question: Is this a bug or am I overlooking something?
>   

Can you post somewhere or send me the xml and xsl files you are using?

Rob