"Closing tag matches nothing" with </param>
I have a PHP file used to generate an Ajax response with the following XML:
<root>
<param name="js_onload">A200</param>
</root>
PhpStorm highlights the closing </param> as "Closing tag matches nothing". Does anyone know why it does this even though there is a <param> tag?
请先登录再写评论。
Hi there,
Please check the file type.
If I place such code into XML file, everything is fine.
But if I place it in HTML file, I see the same message:
What is .php file (from PhpStorm point of view)? -- HTML file with inclusion of PHP (between <?php and ?> tags).
That explains it. The file has a php extension and I was looking through the Settings (Inspections, Intentions, and Language Injection) to try and understand why this was happening. In my example the XML is static, however in the real page some of the XML data is generated using server-side code.
Is there anyway I can let PhpStorm know that a file with PHP extension is really XML and not HTML?
Try this:
This should treat it as XML (with possible PHP inside) instead of default HTML.
Fantastic! That is exactly what I needed. I set the template data language for that directory to be XML. Thank you, Andriy!