Analogue phtml for xml

#1

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

#2

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”

#3

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

#4

Might this be a “short tags” problem?

https://www.php.net/manual/en/language.basic-syntax.phptags.php

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.

#5

Might this be a “short tags” problem?

No.

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.