2017 © Pedro PelĆ”ez
 

library dtd-parser

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

image

soothsilver/dtd-parser

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

  • Thursday, October 23, 2014
  • by Soothsilver
  • Repository
  • 1 Watchers
  • 1 Stars
  • 32 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 7 % Grown

The README.md

Soothsilver PHP DTD Parser

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., (*1)

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., (*2)

Examples

<?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:, (*3)

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

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

require_once __DIR__ . 'SoothsilverDtdParser.php';

The Versions

23/10 2014

dev-master

9999999-dev https://github.com/Soothsilver/dtd-parser

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

  Sources   Download

MIT

The Requires

  • php >=5.3

 

parser xml dtd

23/10 2014

0.1.0

0.1.0.0 https://github.com/Soothsilver/dtd-parser

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

  Sources   Download

MIT

The Requires

  • php >=5.3

 

parser xml dtd