Skip to content
Daniele Orlando edited this page Feb 20, 2016 · 10 revisions

APIs

Functions

function fluidxml($root?, array $options?);  // Concise syntax for: new FluidXml().

function fluidify($file);                    // Concise syntax for: FluidXml::load().

function fluidns($id, $uri, $mode?);         // Concise syntax for: new FluidNamespace().

FluidXml class

class FluidXml

::load($file);

::new($root?, array $options?);              // Alias of __construct(), requires PHP 7.

__construct($root?, array $options?);

->namespace(...$namespace);

->namespaces();

->__invoke(...$query);                       // Concise syntax.
->query(...$query);                          // Extended syntax.

->add($child, ...$optionals);                // Concise.
->addChild($child, ...$optionals);           // Extended.

->prepend($sibling, ...$optionals);          // Concise.
->prependSibling($sibling, ...$optionals);   // Extended.

->append($sibling, ...$optionals);           // Concise.
->appendSibling($sibling, ...$optionals);    // Extended.

->attr(...$arguments);                       // Concise.
->setAttribute(...$arguments);               // Extended.

->text($text);                               // Concise.
->setText($text);                            // Extended.

->addText($text);

->cdata($text);                              // Concise.
->setCdata($text);                           // Extended.

->addCdata($text);

->remove(...$query);

->size();                                    // Concise.
->length();                                  // Extended.

->array();

->dom();

->__toString();                              // Concise.
->xml($strip = false);                       // Extended.

->html($strip = false);

->save($file, $strip = false);

FluidNamespace class

class FluidNamespace

__construct($id, $uri, $mode?);

->id();

->uri();

->mode();

->querify($xpath);

The complete API documentation can be generated executing:

./support/tools/gendoc      # Generated under 'documents/api/'.