XML_Util::createTagFromArray

XML_Util::createTagFromArray() – create a tag from an array

Synopsis

require_once 'XML/Util.php';

string XML_Util::createTagFromArray ( array $tag , integer $replaceEntities = XML_UTIL_REPLACE_ENTITIES )

Description

create a tag from an array. This is similar to XML_Util::createTag(), but more flexible.

Parameter

  • array $tag - array containing information about the tag

  • integer $replaceEntities - whether to replace XML entities in content, embedd it in a CData section or leave it untouched. Possible values are FALSE, XML_UTIL_REPLACE_ENTITIES or XML_UTIL_CDATA_SECTION.

Return value

string xml tag

Note

This function should be called statically.

Usage example

Creating a tag with XML_Util::createTagFromArray()

<?php
require_once "XML/Util.php";

$tag = array(
             
"namespace"    => "xslt",
             
"localPart"    => "variable",
             
"namespaceUri" => "http://www.w3.org/1999/XSL/Transform",
             
"attributes"   => array( "name" => "myVar" ),
             
"content"      => "myValue"
           
);
$string XML_Util::createTagFromArray($tag);
?>
create a tag (Previous) create a start element (Next)
Last updated: Wed, 26 Nov 2014 — Download Documentation
Do you think that something on this page is wrong? Please file a bug report or add a note.
View this page in:

User Notes:

There are no user contributed notes for this page.