定制 neoncitylights/xml 二次开发

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

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

neoncitylights/xml

最新稳定版本:v1.0.2

Composer 安装命令:

composer require neoncitylights/xml

包简介

PHP library that provides a nicer interface over PHP's native XML API

README 文档

README

Packagist License Docs CI Code coverage

A PHP library that provides a nicer, lightweight wrapper around PHP's native XML API.

Install

composer install neoncitylights/xml

Requirements

  • PHP 8.3+
  • libxml (enabled by default in PHP)

Usage

<?php
use Neoncitylights\Xml\Encoding;
use Neoncitylights\Xml\XmlNativeParser;

// create a parser normally, or with an XML namespace
$parser = XmlNativeParser::new(Encoding::Utf8);
$parserNs = XmlNativeParser::newWithNamespace(Encoding::Utf8, ':');

// parse XML
$xmlFileStream = \fopen('example.xml');
while (($data = \fread($xmlFileStream, 16384))) {
    $parser->parse($data); // parse the current chunk
}
$parser->parseFinalize();
\fclose($xmlFileStream);

API Reference

  • Neoncitylights\Xml\Encoding - A string enum of the possible XML text encodings.
  • Neoncitylights\Xml\ErrorCode - An integer enum of the possible XML error codes, backed by core constants.
  • Neoncitylights\Xml\Option - An integer enum of the possible XML options that can be get or set, backed by core constants.
  • Neoncitylights\Xml\XmlNativeParser - A class that wraps around the native XmlParser class and built-in XML parsing functions.
  • Neoncitylights\Xml\XmlParseResult - A class that represents the values passed-by-reference from the xml_parse_into_struct() function.

License

This software is licensed under the MIT license (LICENSE or http://opensource.org/licenses/MIT).

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the MIT license, shall be licensed as above, without any additional terms or conditions.

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-02-20