承接 soothsilver/dtd-parser 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

soothsilver/dtd-parser

最新稳定版本:0.1.0

Composer 安装命令:

composer require soothsilver/dtd-parser

包简介

Simple fully compliant DTD parser that allows you to extract information from Document Type Definition files.

README 文档

README

This is a DTD parser contained a single PHP file that aims to be compliant to the full XML specification. The traditional method of reading XML files in PHP is to use the built-in functions based on libxml2. However, these do not allow you to read and parse Document Type Definition (DTD) files, they only tell you if the DTD is well-formed or not.

With this library, you can parse a DTD file and extract from it general and parameter entities, notations, element definitions and their attribute definitions and also processing instructions.

Examples

Print all declared entities

<?php
$dtd = \Soothsilver\DtdParser\DTD::parseText(file_get_contents("mydtd.dtd"));
foreach($dtd->generalEntities as $entity)
{
 echo $entity->Name . ": " . $entity->replacementText . "\n";
}
foreach($dtd->parameterEntities as $entity)
{
 echo $entity->Name . ": " . $entity->replacementText . "\n";
}

Installation instruction

You can either install this parser via Composer. The package name is soothsilver/dtd-parser. Use the following composer.json file to require it:

{
 "require" : {
  "soothsilver/dtd-parser" : "dev-master" 
 }
}

Alternatively, you may simply include or require the only file this parser is made of:

require_once __DIR__ . 'SoothsilverDtdParser.php';

统计信息

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

GitHub 信息

  • Stars: 4
  • Watchers: 1
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-10-29