B
bizt
Hi,
I am performing an XSLT on a XML feed. The XSLT produces me with PHP
code that I eval then insert into my DB. However, the way that the
system Im assigned to is setup, I need to convert all instances of
comma ',' to entity ',' .. so this requires that the output of the
XSLT needs to produce ',' but instead it converts it to a comma
which the current system doesnt like when handling it.
Below shows a snippet of what I have. What is happening here is that a
text output of PHP code is produced that I will then go on to execute
using PHP eval():
<xsl:template ...>
function ConvertString($str) {
$str = str_replace(',', ',', $str); // , gets converted to a
comma during the XSLT
return $str;
}
</xsl:template>
Ive tried a number of things such as :
$str = str_replace(',', '&#44;', $str);
$str = str_replace(',', '<xsl:text>,</xsl:text>', $str);
$str = str_replace(',', '<![CDATA[,]]>', $str);
<xslutput method="text" encoding="iso-8859-1" indent="no"/>
$str = str_replace(',', ',', $str);
... all with different outputs but none doing what I need.
Can anyone tell me how to output entities as a result of the XSLT?
Thanks
Burnsy
I am performing an XSLT on a XML feed. The XSLT produces me with PHP
code that I eval then insert into my DB. However, the way that the
system Im assigned to is setup, I need to convert all instances of
comma ',' to entity ',' .. so this requires that the output of the
XSLT needs to produce ',' but instead it converts it to a comma
which the current system doesnt like when handling it.
Below shows a snippet of what I have. What is happening here is that a
text output of PHP code is produced that I will then go on to execute
using PHP eval():
<xsl:template ...>
function ConvertString($str) {
$str = str_replace(',', ',', $str); // , gets converted to a
comma during the XSLT
return $str;
}
</xsl:template>
Ive tried a number of things such as :
$str = str_replace(',', '&#44;', $str);
$str = str_replace(',', '<xsl:text>,</xsl:text>', $str);
$str = str_replace(',', '<![CDATA[,]]>', $str);
<xslutput method="text" encoding="iso-8859-1" indent="no"/>
$str = str_replace(',', ',', $str);
... all with different outputs but none doing what I need.
Can anyone tell me how to output entities as a result of the XSLT?
Thanks
Burnsy