Download the PHP package josemmo/uxml without Composer

On this page you can find all versions of the php package josemmo/uxml. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package uxml

Uncomplicated XML

Build Status Latest Version

UXML is an extremely simple PHP library for manipulating XML documents with ease while keeping overhead to a bare minimum.

It consist of just a single class which uses the PHP built-in DOMElement and DOMDocument classes under the hood.

Installation

Using Composer

Without Composer

Download source files from the GitHub repository:

Use the UXML class in your app:

FAQ

Why use this instead of sabre/xml or FluidXML?\ Both those options are great and if they fit your project you should definetely use them! However, in my case I needed something more lightweight to put on top of LibXML's DOM to provide an alternative syntax.

Is UXML compatible with DOMElement?\ Yes, indeed! You can get the original DOMElement instance from an UXML object and vice versa.

I want UXML to do "X". Can you implement it?\ My main goal with this project is not to implement all possible behaviors in the XML specification, you can use the DOM or SimpleXML libraries for that.

Usage

Create a new document

UXML does not distinguish between XML documents (DOMDocument) and elements (DOMElement). Instead, you can create a new document like so:

You can also wrap an already existing DOMElement:

Load an XML document from source

By loading an XML string, UXML will return the root element of the document tree:

Add elements to a node

When adding an element, UXML will return a reference to the newly created element:

You can also define a value:

And even attributes or namespaces:

Element chaining

Because with every element insertion a reference to the new element is returned, you can chain multiple of these calls to create a tree:

Export XML source

Besides casting UXML objects to a string, there is a method for exporting the XML source of an element and its children:

By default, exported strings include an XML declaration (except when casting UXML instances to a string).

Find XML elements

UXML allows you to use XPath 1.0 queries to get a particular element from a document:

Or even multiple elements:

Note all XPath queries are relative to current element:

Remove XML elements

Elements can be removed from the XML tree by calling the remove() method on them. After an element is removed, it becomes unusable:

Namespaces

Namespaces are assigned in the same way as other attributes:

However, when querying elements, the prefix defined in the document may not be the one you are expecting:

To fix this, you can make use of clark notation inside the XPath query:

Advanced XML manipulation

For any other document manipulation outside the scope of this library, you can always interact with the DOMElement instance:


All versions of uxml with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
lib-libxml Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package josemmo/uxml contains the following files

Loading the files please wait ....