Note that there are some explanatory texts on larger screens.

plurals
  1. POXSLT does not work if my XML file has a Schema associated with it
    primarykey
    data
    text
    <p>If I remove the Schema definition from my XML, then my XSLT works, but I can't get it to work with the Schema defined. I know this question has already been answered <a href="https://stackoverflow.com/questions/3836121/xslt-does-not-work-when-i-include-xmlns-http-www-sitemaps-org-schemas-sitemap">here</a>, but I can't seem to get mine to work. I have the following XML header:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;?xml-stylesheet type="text/xsl" href="student.xsl"?&gt; &lt;Students xmlns="http:/www.example.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.example.com student.xsd"&gt; &lt;Student&gt; &lt;SSN&gt;622-12-5748&lt;/SSN&gt; &lt;Name&gt; &lt;First-Name&gt;Alexander&lt;/First-Name&gt; &lt;Last-Name&gt;Mart&lt;/Last-Name&gt; &lt;/Name&gt; &lt;Age&gt;26&lt;/Age&gt; &lt;Institution&gt;UCSF&lt;/Institution&gt; &lt;Email&gt;Alexander@yahoo.com&lt;/Email&gt; &lt;/Student&gt; &lt;/Students&gt; </code></pre> <p>Here is my XSLT file:</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" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:xsi="http://www.example.com"&gt; &lt;xsl:template match="/"&gt; &lt;html&gt; &lt;body&gt; &lt;h2&gt;Student Information&lt;/h2&gt; &lt;table border="1"&gt; &lt;tr bgcolor="yellow"&gt; &lt;th&gt;SSN&lt;/th&gt; &lt;th&gt;First Name&lt;/th&gt; &lt;/tr&gt; &lt;xsl:for-each select="xsi:Students/Student"&gt; &lt;tr&gt; &lt;td&gt; &lt;xsl:value-of select="xsi:SSN"/&gt; &lt;/td&gt; &lt;td&gt; &lt;xsl:value-of select="xsi:Name/First-Name"/&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/xsl:for-each&gt; &lt;/table&gt; &lt;/body&gt; &lt;/html&gt; &lt;/xsl:template&gt; </code></pre> <p></p> <p>What silly mistake am I making? Thanks in advance!</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.
 

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