2

Here's the problem. I am taking returned XML data that is returned from a web application and processing it into HTML through XSLT for the user to see. This works flawlessly on my local WAMP server (Apache 2.2.21, PHP 5.3.8, libxml 2.7.8, libxslt 1.1.23). However when I load it onto my Arvixe Hosted server (Apache 2.2.23, PHP 5.2.17, libxml 2.7.8, libxslt 1.1.27) it fails. I was able to drill down and discover that the xsl transformation is working until I incorporate any conditional statement (choose, when, if, otherwise, etc.) at which point it throws a "500 Internal Server Error". I have checked the error logs and there is nothing related to the problem. If I eliminate all conditional statements and only display the values of each XML node:

<xsl:value-of select="MORTGAGEDATA/APPLICATION/UNDERWRITINGCASE/FHAVA/CaseTypeCD"/>

Everything works fine

But if I add in a conditional statement:

    <xsl:choose>        
        <xsl:when test="MORTGAGEDATA/APPLICATION/UNDERWRITINGCASE/FHAVA/FHAVAFieldOfficeCode = '0670'">
            <xsl:text>Tulsa, OK</xsl:text>
        </xsl:when>
        <xsl:when test="MORTGAGEDATA/APPLICATION/UNDERWRITINGCASE/FHAVA/FHAVAFieldOfficeCode = '0339'">
            <xsl:text>Washington, DC</xsl:text>
        </xsl:when>
        <xsl:when test="MORTGAGEDATA/APPLICATION/UNDERWRITINGCASE/FHAVA/FHAVAFieldOfficeCode = '0344'">
            <xsl:text>Wilmington, DE</xsl:text>
        </xsl:when>
        <xsl:otherwise>
            <xsl:text>Not Applicable</xsl:text>
        </xsl:otherwise>
    </xsl:choose>

The browser displays a 500 Internal Server Error

Anyone have any clue what could cause this?

At my wits end! Cannot for the life of me figure out why this is happening.

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Jeremy Duncan
  • 33
  • 1
  • 6
  • 1
    check your apache error log (try `tail /var/log/apache/error.log`) It should contain more details about the error. – Gordon Nov 05 '12 at 21:56
  • 1
    Check your server's error log for detail. e.g. the causes of 500 errors are logged to /var/log/httpd/error_log on my systems running apache. – Frank Farmer Nov 05 '12 at 21:57
  • I edited the question with another example of a conditional statement that causes the failure. – – Jeremy Duncan Nov 06 '12 at 20:50

2 Answers2

2

Can't comment yet, but I notice in your xsl:when you have MORTGAGEDATA/PROJECT/@FHAVAApprovedCondominiumClassIndicator/@PartyType. Attributes cannot have attribute children.

nine9ths
  • 796
  • 6
  • 15
0

Never could find out why the php 5.3 upgrade caused this but eventually the solution was to transition this function back to php 5 via handlers in the .htaccess file in the directory. Now it works perfectly.

Jeremy Duncan
  • 33
  • 1
  • 6