Ejemplo n.º 1
0
print "splitting qualified tag name (no namespace, but default namespace specified):<br>\n";
print "<pre>";
print_r(XML_Util::splitQualifiedName("foo", "bar"));
print "</pre>";
print "\n<br>\n";
/**
 * verifying XML names
 */
print "verifying 'My private tag':<br>\n";
print "<pre>";
print_r(XML_Util::isValidname('My Private Tag'));
print "</pre>";
print "\n<br><br>\n";
print "verifying '-MyTag':<br>\n";
print "<pre>";
print_r(XML_Util::isValidname('-MyTag'));
print "</pre>";
print "\n<br><br>\n";
/**
 * creating an XML tag
 */
$tag = array("namespace" => "foo", "localPart" => "bar", "attributes" => array("key" => "value", "argh" => "fruit&vegetable"), "content" => "I'm inside the tag");
print "creating a tag with namespace and local part:<br>";
print htmlentities(XML_Util::createTagFromArray($tag));
print "\n<br><br>\n";
/**
 * creating an XML tag
 */
$tag = array("qname" => "foo:bar", "namespaceUri" => "http://foo.com", "attributes" => array("key" => "value", "argh" => "fruit&vegetable"), "content" => "I'm inside the tag");
print "creating a tag with qualified name and namespaceUri:<br>\n";
print htmlentities(XML_Util::createTagFromArray($tag));