Here's a function that will create a CDATA-section around a string coming from SimpleXML.
<?php
function sxml_cdata($path, $string){
$dom = dom_import_simplexml($path);
$cdata = $dom->ownerDocument->createCDATASection($string);
$dom->appendChild($cdata);
}
?>
DOMDocument->createCDATASection()
(No version information available, might be only in CVS)
DOMDocument->createCDATASection() — Create new cdata node
Popis
class DOMDocument {DOMCDATASection createCDATASection ( string $data )
}
This function creates a new instance of class
DOMCDATASection. Tento uzel se v dokumentu neobjeví, nebyl-li přidán
např. funkcí DOMNode->appendChild().
Seznam parametrů
- data
The content of the cdata.
Návratové hodnoty
The new DOMCDATASection or FALSE if an error occured.
Viz také
DOMDocument->createCDATASection()
loathsome
04-Aug-2007 02:28
04-Aug-2007 02:28
