cvs: pear /XML_Util Util.php /XML_Util/examples example.php
| From: | Stephan Schmidt | Date: | Fri, 26 Sep 2003 20:03:38 +0000 |
| Subject: | cvs: pear /XML_Util Util.php /XML_Util/examples example.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-13121@lists.php.net to get a copy of this message | ||
schst Fri Sep 26 16:03:38 2003 EDT
Modified files:
/pear/XML_Util Util.php
/pear/XML_Util/examples example.php
Log:
added example for $defaultNs in splitQualifiedName()
Index: pear/XML_Util/Util.php
diff -u pear/XML_Util/Util.php:1.11 pear/XML_Util/Util.php:1.12
--- pear/XML_Util/Util.php:1.11 Fri Sep 26 16:00:58 2003
+++ pear/XML_Util/Util.php Fri Sep 26 16:03:37 2003
@@ -16,7 +16,7 @@
// | Authors: Stephan Schmidt <schst@php-tools.net> |
// +----------------------------------------------------------------------+
//
-// $Id: Util.php,v 1.11 2003/09/26 20:00:58 schst Exp $
+// $Id: Util.php,v 1.12 2003/09/26 20:03:37 schst Exp $
/**
* uses PEAR errors
@@ -509,7 +509,7 @@
* @param string $defaultNs default namespace (optional)
* @return array $parts array containing namespace and local part
*/
- function splitQualifiedName($qname, $defaultNs)
+ function splitQualifiedName($qname, $defaultNs = null)
{
if (strstr($qname, ':')) {
$tmp = explode(":", $qname);
Index: pear/XML_Util/examples/example.php
diff -u pear/XML_Util/examples/example.php:1.7 pear/XML_Util/examples/example.php:1.8
--- pear/XML_Util/examples/example.php:1.7 Mon Sep 22 07:18:22 2003
+++ pear/XML_Util/examples/example.php Fri Sep 26 16:03:38 2003
@@ -83,6 +83,14 @@
print "</pre>";
print "\n<br>\n";
+ /**
+ * splitting a qualified tag name (no namespace, but default namespace specified)
+ */
+ 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