Bug #68763 [Opn->Spm]: xml_parser

From: Date: Wed, 07 Jan 2015 05:31:04 +0000
Subject: Bug #68763 [Opn->Spm]: xml_parser
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-189697@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=68763&edit=1

 ID:                 68763
 Updated by:         requinix@php.net
 Reported by:        postmaster at angosso dot net
 Summary:            xml_parser
-Status:             Open
+Status:             Spam
 Type:               Bug
 Package:            *XML functions
 Operating System:   Linux
 PHP Version:        5.6.4
 Block user comment: N
 Private report:     N



Previous Comments:
------------------------------------------------------------------------
[2015-01-07 05:25:19] postmaster at angosso dot net

Description:
------------
XML parser based on PHPs built-in xml extension
ini_set("include_path", '/home/angosson/php:' .
ini_get("include_path")  );


Test script:
---------------
<?php
require_once 'XML/Parser.php';

class myParser extends XML_Parser
{
  function myParser()
  {
    parent::XML_Parser();
  }

 /**
  * handle start element
  *
  * @access private
  * @param  resource  xml parser resource
  * @param  string    name of the element
  * @param  array     attributes
  */
  function startHandler($xp, $name, $attribs)
  {
    printf('handle start tag: %s<br />', $name);
  }

 /**
  * handle end element
  *
  * @access private
  * @param  resource  xml parser resource
  * @param  string    name of the element
  */
  function endHandler($xp, $name)
  {
    printf('handle end tag: %s<br />', $name);
  }

 /**
  * handle character data
  *
  * @access private
  * @param  resource  xml parser resource
  * @param  string    character data
  */
  function cdataHandler($xp, $cdata)
  {
    // does nothing here, but might e.g. print $cdata
  }
}

$p = &new Parser();

$result = $p->setInputFile('xml_parser_file.xml');
$result = $p->parse();
?> 

Expected result:
----------------
Build status
(XML, PHP, INI, Apache...)
<?php
$fp = stream_socket_client("tcp://www.example.net:80", $errno, $errstr, 30);
if (!$fp) {
    echo "$errstr ($errno)<br />\n";
} else {
    fwrite($fp, "GET / HTTP/1.0\r\nHost: www.example.net\r\nAccept: */*\r\n\r\n");
    while (!feof($fp)) {
        echo fgets($fp, 1024);
    }
    fclose($fp);
}
?> 



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=68763&edit=1


Thread (2 messages)

« previous php.bugs (#189697) next »