As indicated in one of the answers, this is a mistake. Therefore, you cannot pass both quotes.
But you can replace the double quote with another character, and then use translate to restore the original.
The main thing to choose is a character that will not be displayed in your text. For example, \x7F .
$xsl = new XSLTProcessor(); $xsl->registerPHPFunctions(); $xsl->setParameter("","searchterms", strtr($searchterms, '"', "\x7F")); $xsl->importStylesheet($xslDoc); echo $xsl->transformToXML($doc);
and
<title>search feed for <xsl:value-of select="translate($searchterms, '', '"')"/></title>
In addition, you cannot use html objects as they are escaped.
Or use disable-output-escaping="yes" :
<title>search feed for <xsl:value-of select="$searchterms" disable-output-escaping="yes"/></title>
from
$xsl->setParameter("","searchterms", htmlspecialchars($searchterms));
The first method you can use for inline expressions. For instance:
<title attr="foo {translate($searchterms, '', '"')} bar">bazz</title>
source share