Download the PHP package carlos-veizaga/xml-flow without Composer

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

XmlFlow

A fluent PHP library for building well-formed XML documents, validating them against XSD schemas, and signing them with RSA-SHA256 digital signatures — purpose-built for electronic invoicing systems and any integration that demands strict schema compliance.


Features


Requirements


Installation


Basic usage

Output:


Power features

Root element attributes — ->attributes()

Some schemas require attributes on the root element that are not namespace declarations — for example xsi:noNamespaceSchemaLocation. Use ->attributes() to set them directly on the builder:

Multiple calls to ->attributes() are merged, consistent with ->namespaces().


Null fields — Node::nil()

Some XSD schemas require absent fields to appear explicitly with xsi:nil="true" rather than being omitted. XmlFlow handles this natively.

Note: The xsi namespace must be declared via ->namespaces(). XmlFlow does not inject it automatically — neither driver does.

Elements with custom attributes and text content use Node::create():


Decimal precision — asDecimal() and transform()

PHP silently drops decimal places when casting numbers to strings — (string) 150.0 produces '150', not '150.00'. If your XSD field is xs:decimal, this causes validation failures. asDecimal() fixes it:

value() accepts string, int, or float. The precision defaults to 2 if omitted.

String values — no float conversion

When value() receives a string, asDecimal() normalizes decimal places via string operations — no (float) cast. This is safe for values that exceed IEEE 754 double precision (e.g. amounts from a BCMath-based SDK):

Custom arithmetic — transform(callable)

For rounding, BCMath, GMP, or any other arithmetic strategy, use transform(). The callable receives the raw value and returns the final string. It takes full precedence over asDecimal().


XSD validation

validate() returns $this, so it composes naturally in the chain. It throws XsdValidationException with the raw LibXMLError[] list on failure.


Digital signing — XMLDSig RSA-SHA256

The signature is inserted as the last child of the root element, as required by enveloped XMLDSig. The <ds:Signature> node declares xmlns:ds explicitly to satisfy strict schema validators.

Note: XmlSigner accepts any XML string — it is not coupled to XmlFlow. You can sign documents generated by other means.


High-volume generation — useStreamMode()

For batch jobs generating thousands of documents, switch to the StreamDriver. It uses PHP's XMLWriter extension and keeps memory usage O(1) regardless of document size.

When to use each driver:

Scenario Driver
XMLDSig digital signing DomDriver (default) — signing requires DOM node access
XSD validation via ->validate() DomDriver (default)
Batch / high-volume generation (no signing) StreamDriver via ->useStreamMode()

Switching drivers is transparent — both implement XmlDriverInterface and produce semantically identical output.


Architecture

XmlFlow follows SOLID principles throughout:


Running the tests

The suite covers the builder, Node semantics, driver parity (DomDriver vs StreamDriver), and cryptographic signature verification.


License

MIT © Carlos Veizaga


All versions of xml-flow with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
ext-dom Version *
ext-xmlwriter Version *
ext-openssl Version *
robrichards/xmlseclibs Version ^3.1.5
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 carlos-veizaga/xml-flow contains the following files

Loading the files please wait ...