Download the PHP package edujugon/xml-mapper without Composer

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

XMLMapper for Laravel and PHP

Are you working with xml data? then this package is for you. This is the simplest API to interact with XML data.

Installation

type in console:

Laravel 5.*

Laravel 5.5 or higher?

Then you don't have to either register or add the alias, this package uses Package Auto-Discovery's feature, and should be available as soon as you install it via Composer.

(Laravel < 5.5) Register the XMLMapper service by adding it to the providers array.

(Laravel < 5.5) Let's add the Alias facade, add it to the aliases array.

Usage samples

or

or with Laravel Facade

Don't forget to use the facade use statement at the top of your class: use Edujugon\XMLMapper\Facades\XMLMapper;

Get value

You must know the tags path. Otherwise you should use findValue.

The above example takes the value of the tag with name my-tag.

If no parameter passed to the method it looks up the value of the first (parent) tag.

Get attribute

You must know the tags path. Otherwise you should use findAttribute.

The above example returns the value of the id attribute in my-tag.

Get element

Get a new instance of XMLMapper but with the tag-name element as base xml.

Get elements

Get an array of XMLMapper objects based on the tag-name xml element.

Find value

It looks for the first tag called my-tag and returns its value.

Find attribute

Get the attribute value of a tag.

It looks for the first tag called my-tag, then try to find my-att as attribute and returns its value.

If no tag passed, it takes the first attribute matching the provided attribute name:

Find attribute by condition

Loop through all elements trying to match the condition/s. When found, returns the value of the provided attribute.

Check allowed where operators

Find attributes of a tag

Get an object with those attributes as object properties. First it searches the tag and then retrieves the requested attributes.

If no tag provided, it takes the first tag that has those attributes and return the values.

Find attributes by condition

Loop through all elements trying to match the condition/s. When found, returns an object with those attributes as object properties.

Check allowed where operators

Find all attributes of a tag

Get an array of objects with the tag attributes as properties

Find all attributes of a tag by condition

Get an array of objects with attributes as properties matching the provided tag name and condition.

Check allowed where operators

Where operators

Allowed where syntax.

Default:

Custom:

They can be combined

Replace tag names

You can easily replace any tag name of the xml for an easier access.

The above snippet replaces all tags with names matching the keys and sets their values as new tag names. Also updates the underlying object based on the new xml.

Merge a new xml into the existing one

You can easily merge a new xml into the existing one. It sets it as child of the provided tag.

Wrap the current xml with a custom tag

Add attributes

Enjoy :)


All versions of xml-mapper with dependencies

PHP Build Version
Package Version
Requires illuminate/support Version ^5.0
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 edujugon/xml-mapper contains the following files

Loading the files please wait ....