www.webdeveloper.com
Results 1 to 3 of 3

Thread: size limit when parsin?

  1. #1
    Join Date
    May 2011
    Posts
    13

    size limit when parsin?

    Is there a limit size when parsing an xml? I'm using a code that parse an xml, and writes it as csv. Until the value 3240 it works fine, but the it stops. The xml still has data but is not parsed anymore. My code is
    ----php file---------------------
    $file = "../realtime/zwem_rap_voor_ftp.xml";

    function contents($parser, $data){
    //$da[i] = $data;
    echo $a=$data. ",";
    //echo ",";
    $da[i] = $a;
    $conactenado = $a.$a;
    //$i = $i+1;
    //echo $da[1];
    }

    function startTag($parser, $data){
    //echo $parser;
    }

    function endTag($parser, $data){
    // echo " <BR>";
    }

    $xml_parser = xml_parser_create();

    xml_set_element_handler($xml_parser, "startTag", "endTag");

    xml_set_character_data_handler($xml_parser, "contents");

    $fp = fopen($file, "r");

    $data = fread($fp, 80000);

    if(!(xml_parse($xml_parser, $data, feof($fp)))){
    die("Error on line " . xml_get_current_line_number($xml_parser));
    }

    xml_parser_free($xml_parser);

    fclose($fp);

  2. #2
    Join Date
    Aug 2006
    Posts
    1,902
    Quote Originally Posted by vladyman View Post
    $data = fread($fp, 80000);
    I almost hate to ask, but does 80000 bytes happen to correspond with your 3240 "value"?

    Dave

  3. #3
    Join Date
    May 2011
    Posts
    13

    Thumbs up

    ups missed that point
    thanks so much

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles