Analogue phtml for xml

Is there extension/file type where used XML and also PHP-tags ([?php //some code ?])? I mean, exactly as phtml, but for XML.

Not that I know of. I would probably have the file be a PHP file with a “text/xml” header(). (rather than mess with config to have all XML files parsed by the engine)

If you wanted you could name the files like “something.xml.php”

Problem is that my DevEnv by default creates warning due unknown tags/attributes. Now I resolve it with special comment [!–suppress HtmlUnknownTag, HtmlUnknownAttribute --], but I hoped, there is some format for it that need no those comments

Might this be a “short tags” problem?

I’m a bit confused because I thought the problem was about parsing PHP in an XML file, but the error message looks to be more about XML being read as HTML and not anything to do with PHP.

Might this be a “short tags” problem?


I would to create Active Server Page on base of XML. If I use .xml file, my IDE sees no php tags. If I use .phtml file, IDE creates warning: “Unkmown tag”. Now I resolve it with special supress comments in .phtml file. And I looking for another solution.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.