Beispiel #1
0
 function test_CDATA_Settings()
 {
     $this->reInitialize();
     $token = $this->parser->XML_PullParser_getToken();
     $str_3 = $this->parser->XML_PullParser_getText($token, 0, FALSE);
     $this->assertContains('+%}', $str_3);
     XML_PullParser_excludeBlanksStrict(true);
     $str_3 = $this->parser->XML_PullParser_getText($token, 0, FALSE);
     $this->assertNotContains('+%}', $str_3);
 }
<?php

require_once "XML_PullParser_NS_doc.inc";
XML_PullParser_excludeBlanks(true);
XML_PullParser_trimCdata(true);
XML_PullParser_excludeBlanksStrict(true);
$doc = <<<DOC
<Movies
 xmlns = "http://fedora.gemini.ca/local/"
 xmlns:mov = "http://room535.org/movies/mov/"
 xmlns:star = "http://room535.org/movies/star/"
 xmlns:title = "http://room535.org/movies/title/"
 xmlns:date = "http://room535.org/movies/dates/"
>
 <Movie>
    <title:Title>Gone With The wind</title:Title>
    <date:date date:day="25" date:month="Apr">1939</date:date>
    <star:leading_lady>Vivien Leigh</star:leading_lady>
    <star:leading_man>Clark Gable</star:leading_man>
 </Movie>

  <mov:Movie>
    <title:Title>How Green Was My Valley</title:Title>
    <date:date day = "2" month="May">1941</date:date>
    <star:leading_lady>Maureen O'Hara</star:leading_lady>
    <star:leading_man>Walter Pidgeon</star:leading_man>
 </mov:Movie>

 <Movie>
 <title:Title>Jurassic Park</title:Title>
    <date:date date:day="15" date:month="June">1993</date:date>