HTML5 via XSLT

I generate my HTML using XML/XSLT.

The PHPstorm editor is highlighting HTML5 data tags as errors.

phpstorm.jpg

I've got the Settings > Schemas and DTDs > Default HTML language level set to HTML5.

How can I tell the IDE that it's not an error?

6 comments
Comment actions Permalink

this works fine for me. What PHPStorm build do you use? Is your code defined in .html file? Please can you attach a project that shows up the problem?
Please also check if the problem persists after invalidating caches (File/Invalidate caches)

0
Comment actions Permalink

Just realised it's because I was including the wrong namespace at the top of my xsl file:

<xsl:stylesheet version="1.0"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                exclude-result-prefixes="">

If I remove that, it's ok, but then I don't get any of the autosuggesting for HTML.

Is there a namespace that I can specify for HTML5?

0
Comment actions Permalink

so, what does your resultant HTML look like? '<html xmlns="http://www.w3.org/1999/xhtml">' works fine for me - 'data-' attributes are correctly recognized, completion works as expected

0
Comment actions Permalink

The HTML generated is correct, but that's not my concern. The issue is that the XSLT file has 'data-xyz' tags flagged as errors in the IDE.

0
Comment actions Permalink

I see, so this is not about HTML, but about XSLT... Known issue - http://youtrack.jetbrains.com/issue/WEB-5085

0

Please sign in to leave a comment.