PHPackages                             hm-marketing/onix-parser - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. hm-marketing/onix-parser

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

hm-marketing/onix-parser
========================

A modern PHP library for parsing ONIX (ONline Information eXchange) XML files

1.9.0(9mo ago)1541MITPHPPHP &gt;=7.4

Since Mar 10Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/hmmarketing-ma/onix-parser)[ Packagist](https://packagist.org/packages/hm-marketing/onix-parser)[ RSS](/packages/hm-marketing-onix-parser/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (6)Dependencies (2)Versions (23)Used By (0)

ONIX Parser
===========

[](#onix-parser)

A modern, object-oriented PHP library for parsing ONIX (ONline Information eXchange) XML files. This library supports both ONIX 3.0 namespaced and non-namespaced XML formats.

Features
--------

[](#features)

- **Full ONIX 3.0 XML Support** - Complete parsing of ONIX 3.0 namespaced and non-namespaced XML
- **ChunkOnixParser** - True byte-level resume processing for unlimited file sizes (NEW!)
- **Memory-Efficient Streaming** - Stream large XML files without memory issues
- **Rich Product Information** - Extract all product metadata including titles, descriptions, subjects
- **Physical Product Details** - Page count, dimensions (height, width, thickness), weight with unit conversion
- **Language Support** - Primary language detection with ISO 639 code mapping
- **Publishing Metadata** - Publisher, imprint, country/city of publication, edition details
- **Product Classification** - Product form, product form details with human-readable names
- **Availability &amp; Pricing** - Detailed availability status and comprehensive price information
- **Subject Classification** - Full support for CLIL, THEMA, and ScoLOMFR classification schemes
- **Images &amp; Media** - Extract cover images and other media resources with URL validation
- **Collections &amp; Series** - Hierarchical collection and series relationships
- **Supplier Information** - GLN (Global Location Number) and supplier details
- **Code Mapping** - Extensive ONIX code lists with human-readable translations
- **Comprehensive Logging** - Detailed logging with configurable levels
- **Type Safety** - Well-documented code with PHP type hints
- **Extensible Architecture** - Modular design for easy customization

Requirements
------------

[](#requirements)

- PHP 7.4 or higher
- DOM and SimpleXML extensions (usually included with PHP)
- Composer for dependency management and autoloading

Installation
------------

[](#installation)

```
composer require hm-marketing/onix-parser
```

Or clone the repository and install dependencies:

```
git clone https://github.com/your-username/onix-parser.git
cd onix-parser
composer install
```

Project Structure
-----------------

[](#project-structure)

```
onix-parser/
├── composer.json
├── README.md
├── Example.php
├── src/
│   ├── CodeMaps.php
│   ├── FieldMappings.php
│   ├── Logger.php
│   ├── OnixParser.php
│   └── Model/
│       ├── Collection.php
│       ├── Description.php
│       ├── Header.php
│       ├── Image.php
│       ├── Onix.php
│       ├── Price.php
│       ├── Product.php
│       ├── Subject.php
│       └── Title.php
├── data/
│   ├── clil_codes.json
│   └── thema_codes.json
├── tests/
│   ├── OnixParserTest.php
│   ├── streaming_test.php
│   └── fixtures/
│       └── onix_samples/
│           └── demo.xml
└── vendor/
    └── ...

```

Basic Usage
-----------

[](#basic-usage)

```
