PHPackages                             jas/xml - 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. jas/xml

ActiveLibrary

jas/xml
=======

A XML (Un-)Serialization Library, full configureable via annotations.

012PHP

Since Mar 24Pushed 11y ago1 watchersCompare

[ Source](https://github.com/possi/jas_xml)[ Packagist](https://packagist.org/packages/jas/xml)[ RSS](/packages/jas-xml/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

jas XML-Package
===============

[](#jas-xml-package)

A XML (Un-)Serialization Library, full configureable via annotations.

Installation:
-------------

[](#installation)

Add this line to your composer.json "require" section:

### composer.json

[](#composerjson)

```
    "require": {
       ...
       "jas/xml": "*"
```

Usage
-----

[](#usage)

```
use jas\xml\Meta as Xml;
/**
 * @Xml\Document(rootNode = "foo")
 */
class MyObject {
    /**
     * @var int
     * @Xml\Attribute(name="bar")
     */
    protected $foo = 4;
    /**
     * @var string
     * @Xml\Element(name="hello")
     */
    protected $bar = "hello world";
}

$xml = jas\xml\Writer::toXML(new MyObject); -> /*

  world

*/

$myobject = jas\xml\Reader::fromXML('MyObject', $xml);
```

TODO
----

[](#todo)

- Outsource Reader/Writer-Logic to "layouts". A Layout should describe, how data is mapped between object and XML. This is especially for Lists which might be mixed up by different types of elements, ... That will be a very complex step.
- Group Writer an Reader into a "Processor" that can be configuried with default options, or at which XML-Definitions can be set without Annotations (to support php or yaml configurations and so on). (implementation issue: how to manage "static" usage via reader/writer!?)
- Read attribute/element type from @var-doccomment with namespace parsing
- Namespace support
- Dynamic TypeMap to automaticly convert type-name to class name in an php namespace via callback

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/3a27c82c890ca7f2b378ddb70e141dff634d8305cd8586848cc7547c55cb8819?d=identicon)[possi](/maintainers/possi)

---

Top Contributors

[![possi](https://avatars.githubusercontent.com/u/1308937?v=4)](https://github.com/possi "possi (3 commits)")

### Embed Badge

![Health badge](/badges/jas-xml/health.svg)

```
[![Health](https://phpackages.com/badges/jas-xml/health.svg)](https://phpackages.com/packages/jas-xml)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
