Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Output of an XML-file requires just 3 lines of PHP code, if you use XSLT as transformation language to HTML:</p> <pre><code>&lt;?php $proc=new XsltProcessor; $proc-&gt;importStylesheet(DOMDocument::load("test.xsl")); //load XSL script echo $proc-&gt;transformToXML(DOMDocument::load("soccer_livescore.xml")); //load XML file and echo ?&gt; </code></pre> <p>This is the proper XSLT code for your HTML table (file "test.xsl"):</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt; &lt;xsl:template match="/"&gt; &lt;html&gt; &lt;head/&gt; &lt;body&gt; &lt;table&gt; &lt;tbody&gt; &lt;tr&gt; &lt;th&gt;Local team&lt;/th&gt; &lt;th&gt;Score&lt;/th&gt; &lt;th&gt;Visitor team&lt;/th&gt; &lt;th&gt;Status&lt;/th&gt; &lt;th&gt;Date&lt;/th&gt; &lt;/tr&gt; &lt;xsl:apply-templates select="scores/category[@name='England: Premier League']/matches/match"/&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/body&gt; &lt;/html&gt; &lt;/xsl:template&gt; &lt;xsl:template match="match"&gt; &lt;tr&gt; &lt;td&gt;&lt;xsl:value-of select="localteam/@name"/&gt;&lt;/td&gt; &lt;td&gt;&lt;xsl:value-of select="ht/@score"/&gt;&lt;/td&gt; &lt;td&gt;&lt;xsl:value-of select="visitorteam/@name"/&gt;&lt;/td&gt; &lt;td&gt;&lt;xsl:value-of select="@status"/&gt;&lt;/td&gt; &lt;td&gt;&lt;xsl:value-of select="@formatted_date"/&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/xsl:template&gt; &lt;xsl:template match="*"/&gt; &lt;/xsl:stylesheet&gt; </code></pre> <p>This does not contain all your columns, but it gives the idea. I admit this is not the way you wanted to do it, but it solves your problem and shows how easy it is to use XSLT :-)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload