I've raised this matter before, but I think I may have asked the question in the wrong way.

I use XSLT to generate XHTML output. I therefore have HTML within my XSLT files. PHPStorm currently highlights all the HTML tags with "Cannot resolve symbol" errors so I get a sea of red.

Here's an example file:

<!DOCTYPE xsl:stylesheet SYSTEM "../../config/entities.dtd">

<xsl:stylesheet     xmlns:xsl=""                                           xmlns:html=""


      <xsl:import href="progressBar.xslt"/>

    <xsl:output encoding="utf-8"
                doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"

  |  ROOT

    <xsl:template match="ROOT">
                <xsl:call-template name="head"/>
                <div >

                    <xsl:call-template name="header"/>
                     <h2 >&submitAd_title;</h2>
                    <xsl:call-template name="progressBar">
                     <xsl:with-param name="current" select="'&submitAd_progress_pics;'"/>
                    <xsl:apply-templates select="car"/>
                    <xsl:call-template name="footer"/>

                <xsl:call-template name="scripts"/>
                <xsl:call-template name="localScript"/>


Now PHPStorm is clever enough to work out that it should apply XML inspections, XPATH inspections, it even recognises Javascript within the code.

How do I get it to recognise the HTML? Do I need to define a namespace for the HTML?
Comment actions Permalink

Hello Ted Ted,

What is the file type and PhpStorm version?

Thank you for feedback!

Comment actions Permalink

The file type is .xslt and the version is 2.1.1

I've also had no success in turning off the error tracking and code completion for these files.

Comment actions Permalink

I've cracked it.

My inclusion of my own entities at the top of the page had the impact of making my HTML invalid.

Comment actions Permalink

Yes, you figured this out correctly: IDEA doesn't like the presence of a DTD that doesn't declare the "foreign" elements.



Please sign in to leave a comment.