XSLT: Replace single quotes by \'

后端 未结 5 514
梦毁少年i
梦毁少年i 2021-01-20 18:30

I am using XSLT to transform a XML into a html/php file. In this XSLT I replace some tags by php code and now I have to pass attribute values into that php code. My problem

5条回答
  •  独厮守ぢ
    2021-01-20 19:04

    Here's a simpler, inelegant, but quick method for replacing single quotes:

    '
    
    

    1) Define a variable that contains just an apostrophe. xsl:text is required to get xsl to treat ' as a simple character

    2) Use replace function using that variable as the string to match. In this example, I'm simply removing it.

提交回复
热议问题