PEAR Manual
Prev |  | Next

# Example

Example -- Example for the usage of XML_Util

## Usage example

The following examples shows how some of the methods of XML_Util have to be used.

Example 59-1. Some basic examples
    require_once "XML/Util.php";

    // creating an XML tag
    $tag = XML_Util::createTag("xsl:stylesheet", array("version" => "1.0"), "Place your content here", "http://www.w3.org/1999/XSL/Transform");

    // verify tag name
    $result = XML_Util::isValidName("my Tag");
    if (PEAR::isError($result)) {
        print "Invalid XML name: " . $result->getMessage();
    } else {
        print "Tagname is valid.";
    }

Prev | Home | Next
Introduction | Up | XML_Util::apiVersion()