定制 drinks-it/pixi-saxparser 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

drinks-it/pixi-saxparser

最新稳定版本:6.0.0

Composer 安装命令:

composer require drinks-it/pixi-saxparser

包简介

Sax parser

README 文档

README

The Xml library contains an xml parser, which is able to parse whole xml's or lines from a file stream. It uses the dispatcher component of Symfony2 which makes it easy to react numerous xml structures. As a developer you have the possibility to write your own listener, which will be added to the SAX object. That way you can exactly controll what happens with the xml during parsing.

Quick Start

To run the example application, you must first install the development dependencies via composer. From the root Lib - XML, run:

$ php composer install

After including the autoload.php into your project you can start using the parser.

NOTE: The parser wont return anything unless you've created a listener that do so.

To initialize the parser and adding a listener use following code snippet:

:::PHP
<?php
$saxParser = new pixi\Xml\Parser\Sax();
$saxParser ->dispatcher->addSubscriber(new Your\Own\Listener());
?>

To start the parsing process you can simply run the parse method.

:::PHP
<?php
$saxParser = new pixi\Xml\Parser\Sax();
$saxParser ->dispatcher->addSubscriber(new Your\Own\Listener());

while(!feof($fp)) {
	$saxParser ->parse(fread($fp), 4096);
}
?>

NOTE: For more details visit the library wiki

统计信息

  • 总下载量: 7.67k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 2
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-03-23