Download the PHP package kuria/dom without Composer

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

DOM ###

Wrappers around the PHP DOM classes that handle the common DOM extension pitfalls.

Features

Requirements

Container methods

These methods are shared by both HTML and XML containers.

Loading documents

<library> <book name="Don Quixote" author="Miguel de Cervantes" /> <book name="Hamlet" author="William Shakespeare" /> <book name="Alice's Adventures in Wonderland" author="Lewis Carroll" /> </library> XML;

$dom = XmlDocument::fromString($xml);

foreach ($dom->query('/library/book') as $book) { /* @var \DOMElement $book / var_dump("{$book->getAttribute('name')} by {$book->getAttribute('author')}"); }

Output:

string(34) "Don Quixote by Miguel de Cervantes"
string(29) "Hamlet by William Shakespeare"
string(49) "Alice's Adventures in Wonderland by Lewis Carroll"

Creating a new document

<users> <user username="bob" access-token="123456"/> <user username="john" access-token="foobar"/> </users>

Handling XML namespaces in XPath queries

<lib:root xmlns:lib="http://example.com/"> <lib:book name="Don Quixote" author="Miguel de Cervantes" /> <lib:book name="Hamlet" author="William Shakespeare" /> <lib:book name="Alice's Adventures in Wonderland" author="Lewis Carroll" /> </lib:root> XML;

$dom = XmlDocument::fromString($xml);

// register namespace in XPath $dom->getXpath()->registerNamespace('lib', 'http://example.com/');

// query using the prefix foreach ($dom->query('//lib:book') as $book) { /* @var \DOMElement $book / var_dump($book->getAttribute('name')); }

Output:

string(11) "Don Quixote"
string(6) "Hamlet"
string(32) "Alice's Adventures in Wonderland"

XML fragments

Loading an existing fragment

$dom = XmlFragment::fromString('<fruits><fruit name="Apple" /><fruit name="Banana" /></fruits>');

foreach ($dom->query('/fruits/fruit') as $fruit) { /* @var \DOMElement $fruit / var_dump($fruit->getAttribute('name')); }

Output:

string(5) "Apple"
string(6) "Banana"

Creating a new fragment

// initialize empty fragment $dom = new XmlFragment(); $dom->loadEmpty(['formatOutput' => true]);

// add a new element $person = $dom->getDocument()->createElement('person'); $person->setAttribute('name', 'John Smith');

$dom->getRoot()->appendChild($person);

// save echo $dom->save();

Output:

<person name="John Smith"/>

All versions of dom with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
kuria/simple-html-parser Version ^2.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 kuria/dom contains the following files

Loading the files please wait ....