Login +

Reference Guide / SLS_XMLToolbox

SLS_XMLToolbox1 is a utility class for handling XML.


At Controller level

If you want to enrich the XML stream, you get the current instance SLS_XMLToolbox1 and save at the end of your action :

$xml = $this->getXML();

// Your action code


At Components or Statics level

You work directly with the current reference of SLS_XMLToolbox1 :


The enhanced information will be stored in the root node //Statics/Site/statics_name/ for a Statics and //Components/Site/component_name/ for a Component.

At other level (PHP)

You can create a new instance of the class :

$xml = new SLS_XMLToolbox();

Construction of nodes

To open a node, simply call the startTag() function:

// will produce <node>

To close a node, simply call the endTag() function:

// will produce </node>

Finally, to open a node, fill its content and close it, you can call the addFullTag() function:

// will produce <node><![CDATA[content]]></node>

The third parameter lets you specify whether you want to protect the contents of the node with CDATA.

Extraction of nodes

Three main functions allow you to make querying xPATH :

- To retrieve a single value


- To retrieve a collection of values


- To retrieve a collection of attributes



  1. SLS_XMLToolbox - Tool SLS_XMLToolbox - XML Treatment