Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You have some problems around the root element of the XML</p> <pre><code>&lt;urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"&gt; </code></pre> <p>You have specified a default namespace here, meaning this element and all descendants (unless overridden with another namespace declaration) belong to that namespace. But there is no mention of the namespace at all in the XSLT, and so all your XPath expressions are looking for elements in NO namespace.</p> <p>What you need to do in your XSLT is first declare your namespace, like so (the prefix 'sm' can be anything really, as long as uri matches the one in the XML)</p> <pre><code>&lt;xsl:stylesheet version="1.0" xmlns:sm="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt; </code></pre> <p>Then, wherever you reference an element in an xpath expression, is should be prefixed with the namespace prefix. For example</p> <pre><code> &lt;xsl:for-each select="sm:url"&gt; &lt;tr&gt; &lt;td&gt;&lt;xsl:value-of select="sm:loc"/&gt;&lt;/td&gt; &lt;td&gt;&lt;xsl:value-of select="sm:priority"/&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/xsl:for-each&gt; </code></pre> <p>The other issue is that you start off by matching the document node <code>&lt;xsl:template match="/"&gt;</code>, but then within this template you do the xsl:for-each for the <strong>url</strong> element. But at this point, it is the <strong>urlset</strong> element that will be the immediate child element. Try changing the initial template match to this</p> <pre><code>&lt;xsl:template match="/sm:urlset"&gt; </code></pre> <p>Then, your <strong>xsl:for-each</strong> should find something.</p> <p>Of course, there may still be other problems. You need to ensure the XML you are outputing with PHP is well-formed, for a start.</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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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