Download the PHP package aydin-hassan/xml-fuse without Composer

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

XmlFuse

Build Status Coverage Status Scrutinizer Code Quality Latest Stable Version Latest Untable Version

A Small library for merging scalar data from multiple XPaths's. Similar to an SQL Join, but using XML.

This library is useful if you want to convert XML data into a flat format. This is useful for a source agnostic approach. For example, you may process data from multiple source but want to normalise them all to a similar format.

This library aims to convert 3 dimensional data in to a flat array. Take the following XML as an example:

Imagine an import which updates the status of each item associated with an order. The import only accepts a flat array of data and can only process one item at a time. In order to update the status of an Item, the import must also know the order ID in order to load it and interact with its items.

We could use an xpath to loop each order item like so: //order/lines/line and this would give us all the item information, but we still don't have the order ID in the data. What if we could get the data like so:

This data structure is each of the nodes within each <line> embedded with the parent node's data. We can succesfully pass each of these data structures to our order status updater class, and it has all the data it needs to do its work.

Installation

Composer

Usage

To use the tool you should instantiate the XmlFuser class, passing in your XML and the XPath's you want to combine. You can then call parse() to get an array of records back.

Example:

What's going on?

Each of the XPath's passed in to the parser are processed in the order they are given. So the XML will be loaded and the first XPath search will be performed. This will produce an array of nodes (of which there is one).

Each piece of data in the node, which isn't a nested structure will be moved to an array. So we have: orderId & customerEmail:

is skipped because it is a nested structure. Now from this point, the next XPATH is searched, remember our current position? (). Our second XPath is: `lines/line` this will return an array of nodes. Now each nodes scalar data (non-nested) is converted to an array. Eg: It is then merged with the data from the parent search, the node. Which will leave us with: This is then repeated for each node. Notes ----- 1. Any amount of XPaths can be given, if they return no results, then no merging will be done, the parent will be returned instead. 2. You can use the `setXPaths()` method to pass in a new set of XPaths, and call the `parse()` method to reparse the XML. Contributing & Running Tests ----------------------------

All versions of xml-fuse with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4
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 aydin-hassan/xml-fuse contains the following files

Loading the files please wait ....