Please, can someone help with this script that's not working

I have a testimonials section on apply.newummah.com that should fade into multiple sections but it is not working. I have tried to use the firefox console to troubleshoot but can’t see the issue.
Here is the code I’ve used in the index file

<div id="testimonials">
        <ul>
        <!--?php
           
                $xmlFile = 'xml/testimonials.xml';
                $xslFile = 'xml/transform.xml';
               
                $doc = new DOMDocument();
                $xsl = new XSLTProcessor();
               
                $doc--->load($xslFile);
                $xsl-&gt;importStyleSheet($doc);
               
                $doc-&gt;load($xmlFile);
                echo $xsl-&gt;transformToXML($doc);
           
            ?&gt;
        </ul>
</div>

I have placed links to styles.css in the header and linked to jquery library and js file before the end body tag.
I think perhaps there may be a position issue maybe?

Many thanks if you can help me solve it

Well I can see that your PHP code isn’t going to execute because of the invalid opening tag used. You’ve also got errors in your PHP syntax that would prevent it from parsing too. Replace your PHP code with the following:

            <?php
                $xmlFile = 'xml/testimonials.xml';
                $xslFile = 'xml/transform.xml';
                $doc = new DOMDocument();
                $xsl = new XSLTProcessor();
                $doc->load($xslFile);
                $xsl->importStyleSheet($doc);
                $doc->load($xmlFile);
                echo $xsl->transformToXML($doc);
            ?>

Your PHP code should now execute and output the XML (assuming that it’s well-formed, that is). If something’s not working now, then you’ll need to provide more information about the error you’re receiving/problems you’re having.

Many thanks. I will replace the code, check it out and get back to you

Hi,

I see why now your saying the php tag is wrong. The code I am using is correct but it was not being read in the browser as php because I was using index.html so I switched to index.php but now the browser is not reading my code at all when I check inspect elements code.

so I used the code you posted above in index.php but if you look at the testimonial section under the big vision on apply.newummah.com the php code is non existent

Please help

There seems to be errors in your XML document (on lines 5, 10, and 15). You’ll need to fix those errors before PHP will parse the XML document (warnings are being emitted for me, though your error level settings may not be high enough on your host for you to see them).

EDIT: here’s what the errors are saying:

Warning: DOMDocument::load(): xmlParseEntityRef: no name in http://apply.newummah.com/xml/testimonials.xml, line: 5 in ...

Warning: DOMDocument::load(): xmlParseEntityRef: no name in http://apply.newummah.com/xml/testimonials.xml, line: 10 in ...

Warning: DOMDocument::load(): xmlParseEntityRef: no name in http://apply.newummah.com/xml/testimonials.xml, line: 15 in ...

Apologies for the trouble again. Still facing some problems. Please help. Thanking you in anticipation.

I have this in my testimonials.xml file so what could be wrong with that? And why is the php code that is in my index.php not even showing in the code when using inspect element?

<?xml version="1.0" encoding="utf-8"?>
 
<testimonials>
    <item>
        <content>The concept of making the true halal lifestyle accessible to everyone is wonderful & welcomed</content>
        <author-name>Ahmed</author-name>
        <author-url></author-url>
    </item>
    <item>
        <content>The concept of making the true halal lifestyle accessible to everyone is wonderful & welcomed.</content>
        <author-name>Aisha</author-name>
        <author-url></author-url>
    </item>
    <item>
        <content>The concept of making the true halal lifestyle accessible to everyone is wonderful & welcomed</content>
        <author-name>Hantaah</author-name>
    </item>
</testimonials>

and here is what is in the transform.xml

<?xml version="1.0" encoding="utf-8"?>
 
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="utf-8" indent="no"/>
 
<xsl:template match="/testimonials">
    <xsl:for-each select="item">
   
    <li>
        <p class="text">
            <xsl:value-of select="content"/>
        </p>
       
        <p class="author">
            <xsl:value-of select="author-name"/>
           
            <xsl:if test="author-url != '' ">
                <xsl:value-of select="', '"/>
                <a>
                    <xsl:attribute name="href">
                        <xsl:value-of select="concat(author-url)"/>
                    </xsl:attribute>
                   
                    <xsl:value-of select="author-url"/>
                </a>
            </xsl:if>
        </p>
    </li>
   
    </xsl:for-each>
</xsl:template>
 
</xsl:stylesheet>