You are here: PHP5.1.4, DOM using CDATA in XSLT « PHP Programming Language « IT news, forums, messages
PHP5.1.4, DOM using CDATA in XSLT

Posted by R on 12/17/42 11:55

Hi All,

I've run into very disturbing problem, I must use html tags inside one
of my XML node

so I wrote:

$cdataHelp = $DomDocument->createCDATASection($value);

when I dump it as XML

header('Content-Type: text/xml; charset=UTF-8"');
echo $DomDocument->saveXML();

CDATA is displayed (and its HTML tags) properly, when applying a
stylesheet:

$xslt = new xsltProcessor();
$xslt->importStyleSheet(DomDocument::load($styleSheetName));
echo $xslt->transformToXML($DomDocument);

with XSL stylesheet with:

<xsl:value-of select="help" disable-output-escaping="yes"/>

all < and > become &lt; and &gt; and I can see them in my browser as a
part of text.

it looks like DOM API supports adding CDATA sections but XSLTProcessor
doesn't support it

Is there some work-around for using CDATA + XSLT (PHP5)?

thanks in advance for shedding more light on this problem

best regards
R

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация