more CDATA fixes

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@63122 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Friedhelm Betz 2001-11-23 17:59:34 +00:00
parent 1dbef32688
commit 535c21f790

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.21 $ -->
<!-- $Revision: 1.22 $ -->
<reference id="ref.xml">
<title>XML parser functions</title>
<titleabbrev>XML</titleabbrev>
@ -1669,7 +1669,7 @@ $xml_parser->parse("<A ID=\"hallo\">PHP</A>");
<informalexample>
<programlisting role="php">
<![CDATA[
$simple = &quot;<para><note>simple note</note></para>&quot;;
$simple = "<para><note>simple note</note></para>";
$p = xml_parser_create();
xml_parse_into_struct($p,$simple,$vals,$index);
xml_parser_free($p);
@ -1788,7 +1788,7 @@ class AminoAcid {
function readDatabase($filename) {
// read the xml database of aminoacids
$data = implode(&quot;&quot;,file($filename));
$data = implode("",file($filename));
$parser = xml_parser_create();
xml_parser_set_option($parser,XML_OPTION_CASE_FOLDING,0);
xml_parser_set_option($parser,XML_OPTION_SKIP_WHITE,1);
@ -1797,7 +1797,7 @@ function readDatabase($filename) {
// loop through the structures
foreach ($tags as $key=>$val) {
if ($key == &quot;molecule&quot;) {
if ($key == "molecule") {
$molranges = $val;
// each contiguous pair of array entries are the
// lower and upper range for each molecule definition
@ -1815,11 +1815,11 @@ function readDatabase($filename) {
function parseMol($mvalues) {
for ($i=0; $i < count($mvalues); $i++)
$mol[$mvalues[$i][&quot;tag&quot;]] = $mvalues[$i][&quot;value&quot;];
$mol[$mvalues[$i]["tag"]] = $mvalues[$i]["value"];
return new AminoAcid($mol);
}
$db = readDatabase(&quot;moldb.xml&quot;);
$db = readDatabase("moldb.xml");
echo "** Database of AminoAcid objects:\n";
print_r($db);