+ /**
+ * Retrieves the document namespace
+ *
+ * @return mixed
+ * @access private
+ */
+ function _getNamespace()
+ {
+ require('HTML/Page/Namespaces.php');
+
+ if (isset($this->_doctype['type'])) {
+ $type = $this->_doctype['type'];
+ }
+
+ if (isset($this->_doctype['version'])) {
+ $version = $this->_doctype['version'];
+ }
+
+ if (isset($this->_doctype['variant'])) {
+ $variant = $this->_doctype['variant'];
+ }
+
+ $strNamespace = '';
+
+ if (isset($variant)){
+ if (isset($namespace[$type][$version][$variant][0]) && is_string($namespace[$type][$version][$variant][0])) {
+ $strNamespace = $namespace[$type][$version][$variant][0];
+ } elseif (isset($namespace[$type][$version][0]) && is_string($namespace[$type][$version][0]) ) {
+ $strNamespace = $namespace[$type][$version][0];
+ } elseif (isset($namespace[$type][0]) && is_string($namespace[$type][0]) ) {
+ $strNamespace = $namespace[$type][0];
+ }
+ } elseif (isset($version)) {
+ if (isset($namespace[$type][$version][0]) && is_string($namespace[$type][$version][0]) ) {
+ $strNamespace = $namespace[$type][$version][0];
+ } elseif (isset($namespace[$type][0]) && is_string($namespace[$type][0]) ) {
+ $strNamespace = $namespace[$type][0];
+ }
+ } else {
+ if (isset($namespace[$type][0]) && is_string($namespace[$type][0]) ) {
+ $strNamespace = $namespace[$type][0];
+ }
+ }
+
+
+ if ($strNamespace) {
+ return $strNamespace;
+ } else {
+ return PEAR::raiseError('Error: "'.$this->getDoctypeString().'" does not have a default namespace. Use setNamespace() to define your namespace.',
+ 0,PEAR_ERROR_TRIGGER);
+ }
+
+ } // end func _getNamespace
+