1

I am getting fatal error: The prefix "xsl" for element "xsl:stylesheet" is not bound.

ERROR: 'The prefix "xsl" for element "xsl:stylesheet" is not bound.' FATAL ERROR: 'Could not compile stylesheet' javax.xml.transform.TransformerConfigurationException: Could not compile stylesheet at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTemplates(Unknown Source) at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTransformer(Unknown Source) at com.quicklyjava.JavaXSLT.main(JavaXSLT.java:20)

<xsl:stylesheet version="1.0"> 
 <xsl:template match="/">
  <html>
   <body>
    <h1>Movies</h1>
    <table border="3">
     <tr bgcolor="grey">
    <th>Genre</th>
    <th>Title</th>
    <th>Director</th>
    <th>Price</th>
     </tr>
   <xsl:for-each select="movies/movie">
     <tr>
    <td>
        <xsl:value-of select="@genre"/>
    </td>
    <td>
        <xsl:value-of select="title"/>
    </td>
    <td>
        <xsl:value-of select="director"/>
    </td>
    <td>
        <xsl:value-of select="price"/>
    </td>
      </tr>
   </xsl:for-each>
   </table>
   </body>
  </html>
</xsl:template>
</xsl:stylesheet>
0

1 Answer 1

2

I suppose you're missing the xsl namespace declaration:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
Sign up to request clarification or add additional context in comments.

2 Comments

@user3073182 To be more clear, please accept this answer if it solved your problem.
Also, I know we all have to start somewhere, but I'm puzzled as to why it was necessary to ask this question. If the message isn't self-explanatory, then you need to do some reading before do any more coding; you're not going to understand error messages unless you understand the concepts of the language, and the only way to understand the concepts is to read before your write.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.