2017 © Pedro PelĂĄez
 

library xml

XML APIs for the XP Framework

image

xp-framework/xml

XML APIs for the XP Framework

  • Monday, April 2, 2018
  • by thekid
  • Repository
  • 2 Watchers
  • 1 Stars
  • 39,954 Installations
  • PHP
  • 11 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 16 Versions
  • 8 % Grown

The README.md

XML APIs for the XP Framework

Build status on GitHub XP Framework Module BSD Licence Requires PHP 7.0+ Supports PHP 8.0+ Latest Stable Version, (*1)

The xml package provides APIs to handle XML., (*2)

XML data

Most of the time, XML is used to hold data. In this case, a fully blown DOM api is too much overhead to work with the data. This is where the xml.Tree class comes in., (*3)

This example will print out a nicely formatted XML document:, (*4)

use xml\{Tree, Node};

$t= new Tree('customer');
$t->root()->setAttribute('id', '6100');
$t->addChild(new Node('name', 'Timm Übercoder'));
$t->addChild(new Node('email', 'uebercoder@example.com'));

echo $t->getSource(INDENT_DEFAULT);

XSL Transformation

The DomXSLProcessor class uses LibXSLT and thus supports EXSLT features like user functions, callbacks, string functions, dynamic evaluation and more., (*5)

A simple example:, (*6)

use xml\DomXSLProcessor;
use xml\TransformerException;
use util\cmd\Console;

$proc= new DomXSLProcessor();
$proc->setXSLFile('test.xsl');
$proc->setXMLFile('test.xml');

try {
  $proc->run();
} catch (TransformerException $e) {
  // Handle
}

Console::writeLine($proc->output());

XPath queries

use xml\XPath;
use util\cmd\Console;

$xml= '<dialog id="file.open">
 <caption>Open a file</caption>
   <buttons>
     <button name="ok"/>
     <button name="cancel"/>
   </buttons>
</dialog>';

Console::writeLine((new XPath($xml))->query('/dialog/buttons/button/@name')));

The Versions

02/04 2018

dev-master

9999999-dev http://xp-framework.net/

XML APIs for the XP Framework

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

module xp

02/04 2018

v9.0.1

9.0.1.0 http://xp-framework.net/

XML APIs for the XP Framework

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

module xp

29/05 2017

v9.0.0

9.0.0.0 http://xp-framework.net/

XML APIs for the XP Framework

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

module xp

20/05 2017

v8.0.2

8.0.2.0 http://xp-framework.net/

XML APIs for the XP Framework

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

module xp

31/01 2017

v8.0.1

8.0.1.0 http://xp-framework.net/

XML APIs for the XP Framework

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

module xp

28/08 2016

v8.0.0

8.0.0.0 http://xp-framework.net/

XML APIs for the XP Framework

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

module xp

20/04 2016

v7.0.1

7.0.1.0 http://xp-framework.net/

XML APIs for the XP Framework

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

module xp

21/02 2016

v7.0.0

7.0.0.0 http://xp-framework.net/

XML APIs for the XP Framework

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

module xp

24/01 2016

v6.3.1

6.3.1.0 http://xp-framework.net/

XML APIs for the XP Framework

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

module xp

20/12 2015

v6.3.0

6.3.0.0 http://xp-framework.net/

XML APIs for the XP Framework

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

module xp

09/12 2015

v6.2.2

6.2.2.0 http://xp-framework.net/

XML APIs for the XP Framework

  Sources   Download

BSD-3-Clause

The Requires

 

module xp

12/07 2015

v6.2.1

6.2.1.0 http://xp-framework.net/

XML APIs for the XP Framework

  Sources   Download

BSD-3-Clause

The Requires

 

module xp

14/06 2015

v6.2.0

6.2.0.0 http://xp-framework.net/

XML APIs for the XP Framework

  Sources   Download

BSD-3-Clause

The Requires

 

module xp

31/05 2015

v6.1.0

6.1.0.0 http://xp-framework.net/

XML APIs for the XP Framework

  Sources   Download

BSD-3-Clause

The Requires

 

module xp

12/02 2015

v6.0.1

6.0.1.0 http://xp-framework.net/

XML APIs for the XP Framework

  Sources   Download

BSD-3-Clause

The Requires

 

module xp

10/01 2015

v6.0.0

6.0.0.0 http://xp-framework.net/

XML APIs for the XP Framework

  Sources   Download

BSD-3-Clause

The Requires

 

module xp