Insert PHP in HTML-Form via XSLT

Oxygen general issues.
florin_nica
Posts: 32
Joined: Wed Sep 09, 2020 3:17 pm

Re: Insert PHP in HTML-Form via XSLT

Post by florin_nica »

Hello,

One solution to ensure that the closing parenthesis in the PHP statement is not converted to "&gt;" could be to use a CDATA (Character Data) section in your XSLT template. By wrapping the PHP statement with <![CDATA[ ... ]]>, you prevent the XML parser from interpreting the content, and it will be output as-is in the resulting HTML.

Another solution could be to perform a string replacement on the result of the PHP statement, something like:

Code: Select all

<xsl:variable name="php01_replaced" select="replace($php01, '&gt;', '>')" />
Hope this helps.

Regards,
Florin
florin_nica
Posts: 32
Joined: Wed Sep 09, 2020 3:17 pm

Re: Insert PHP in HTML-Form via XSLT

Post by florin_nica »

Hello,

I am not sure why this doesn't work. At the moment, no other idea comes to my mind, but you may want to take a look at this topic, which is related to PHP statements used in XSLT: common-problems/topic6588.html

Regards,
Florin
Post Reply