Download the PHP package danmichaelo/quitesimplexmlelement without Composer

On this page you can find all versions of the php package danmichaelo/quitesimplexmlelement. 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 quitesimplexmlelement

QuiteSimpleXMLElement

Build Status Coverage Status Code Quality SensioLabsInsight Latest Stable Version Total Downloads

The QuiteSimpleXMLElement class is a small wrapper built around the SimpleXMLElement class that adds some convenience methods and makes it easier to work with namespaces. The main reason for developing the class was to let objects returned by the xpath() method inherit namespaces from the original object. The package was formerly known as CustomXMLElement.

QuiteSimpleXMLElement supports PHP 5.6 and 7.x. If you need PHP 5.3 support, use the 0.4.* version range as PHP 5.3 support was removed in version 0.5.

The library is actively maintained and pull requests are welcome.

Why this library was developed

Taking an example document,

Using SimpleXMLElement I found myself having to register namespaces over and over again:

When using QuiteSimpleXMLElement, it should only be necessary to register the namespaces once and for all.

The namespaces can also be defined using the alternative constructor QuiteSimpleXMLElement::make:

A note on the design: I would have preferred to extend the original SimpleXMLElement class, but the constructor is static, which is why I wrote a wrapper instead.

Helper methods

The library defines some new methods to support less typing and cleaner code.

attr($name)

Returns the value of an attribute as a string. Namespace prefixes are supported.

text($xpath)

Returns the text content of the node

first($xpath)

Returns the first node that matches the given path, or null if none.

all($xpath)

Returns all nodes that matches the given path, or an empty array if none.

has($xpath)

Returns true if the node exists, false if not

setValue($value)

Sets the value of a node

replace($newNode)

Replaces the current node with a new one. Example:

gives

Works with namespaces as well, but any namespaces used in the replacement node must be specified in that document as well. See QuiteSimpleXMLElementTest.php for an example.


All versions of quitesimplexmlelement with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
ext-simplexml 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 danmichaelo/quitesimplexmlelement contains the following files

Loading the files please wait ....