Forum Moderators: coopster
I have a blob of xml stored in my database and it contains <para> elements(which i want that para text to have substitutions made on it not rest of xml content)
so in my xslt, my 'para' template does a call to a php function like so
<xsl:template match="paragraph">
<xsl:variable name="contents"><xsl:value-of select="."/></xsl:variable>
<paragraph><xsl:value-of select="php:function(linkParaText, string($contents))"/></paragraph>
</xsl:template>
my php function then returns a string of content then after substitution has been made
My delima:
The substitution I do is linking certain word to text
Making: some text
Into: <a href="blah">some text</a>
for example..
but when php return the string, xslt treates it as a string and converts < into < etc
and I can't then print that to scrren as the <a href shows as text instead of linkinfg the text like normal html
Anybody know how I can convert this back to dom rather then string in the xslt or how i should do the return any different.
my php finction is like so
function linkParaText($paraXML){
global $myArray;
$newParaXML = str_ireplace(array_keys($myArray), array_values($myArray), $paraXML);
return $newParaXML;
}
Thanks
Trent
Good luck!