HTML5 via XSLT
I generate my HTML using XML/XSLT.
The PHPstorm editor is highlighting HTML5 data tags as errors.
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?
请先登录再写评论。
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)
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?
According to http://www.w3.org/TR/2011/WD-html5-20110113/namespaces.html, the HTML namespace is correct.
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
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.
I see, so this is not about HTML, but about XSLT... Known issue - http://youtrack.jetbrains.com/issue/WEB-5085