Overview

Packages

  • Xml
    • Wbxml

Classes

  • Horde_Xml_Wbxml
  • Horde_Xml_Wbxml_ContentHandler
  • Horde_Xml_Wbxml_Decoder
  • Horde_Xml_Wbxml_Dtd
  • Horde_Xml_Wbxml_Dtd_SyncMl
  • Horde_Xml_Wbxml_Dtd_SyncMlDevInf
  • Horde_Xml_Wbxml_Dtd_SyncMlMetInf
  • Horde_Xml_Wbxml_DtdManager
  • Horde_Xml_Wbxml_Encoder
  • Horde_Xml_Wbxml_Exception
  • Horde_Xml_Wbxml_HashTable
  • Horde_Xml_Wbxml_LifoQueue
  • Overview
  • Package
  • Class
  • Tree
 1: <?php
 2: /**
 3:  * From Binary XML Content Format Specification Version 1.3, 25 July 2001
 4:  * found at http://www.wapforum.org
 5:  *
 6:  * Copyright 2003-2012 Horde LLC (http://www.horde.org/)
 7:  *
 8:  * See the enclosed file COPYING for license information (LGPL). If you
 9:  * did not receive this file, see http://www.horde.org/licenses/lgpl21.
10:  *
11:  * @author  Anthony Mills <amills@pyramid6.com>
12:  * @package Xml_Wbxml
13:  */
14: class Horde_Xml_Wbxml_DtdManager
15: {
16:     /**
17:      * @var array
18:      */
19:     protected $_strDTD = array();
20: 
21:     /**
22:      * @var array
23:      */
24:     protected $_strDTDURI = array();
25: 
26:     /**
27:      */
28:     public function __construct()
29:     {
30:         $this->registerDTD(Horde_Xml_Wbxml_Dtd::SYNCML_1_0, 'syncml:syncml1.0', new Horde_Xml_Wbxml_Dtd_SyncMl(0));
31:         $this->registerDTD(Horde_Xml_Wbxml_Dtd::SYNCML_1_1, 'syncml:syncml1.1', new Horde_Xml_Wbxml_Dtd_SyncMl(1));
32:         $this->registerDTD(Horde_Xml_Wbxml_Dtd::SYNCML_1_2, 'syncml:syncml1.2', new Horde_Xml_Wbxml_Dtd_SyncMl(2));
33: 
34:         $this->registerDTD(Horde_Xml_Wbxml_Dtd::METINF_1_0, 'syncml:metinf1.0', new Horde_Xml_Wbxml_Dtd_SyncMlMetInf(0));
35:         $this->registerDTD(Horde_Xml_Wbxml_Dtd::METINF_1_1, 'syncml:metinf1.1', new Horde_Xml_Wbxml_Dtd_SyncMlMetInf(1));
36:         $this->registerDTD(Horde_Xml_Wbxml_Dtd::METINF_1_2, 'syncml:metinf1.2', new Horde_Xml_Wbxml_Dtd_SyncMlMetInf(2));
37: 
38:         $this->registerDTD(Horde_Xml_Wbxml_Dtd::DEVINF_1_0, 'syncml:devinf1.0', new Horde_Xml_Wbxml_Dtd_SyncMlDevInf(0));
39:         $this->registerDTD(Horde_Xml_Wbxml_Dtd::DEVINF_1_1, 'syncml:devinf1.1', new Horde_Xml_Wbxml_Dtd_SyncMlDevInf(1));
40:         $this->registerDTD(Horde_Xml_Wbxml_Dtd::DEVINF_1_2, 'syncml:devinf1.2', new Horde_Xml_Wbxml_Dtd_SyncMlDevInf(2));
41:     }
42: 
43:     /**
44:      */
45:     public function getInstance($publicIdentifier)
46:     {
47:         $publicIdentifier = Horde_String::lower($publicIdentifier);
48:         if (isset($this->_strDTD[$publicIdentifier])) {
49:             return $this->_strDTD[$publicIdentifier];
50:         }
51:     }
52: 
53:     /**
54:      */
55:     public function getInstanceURI($uri)
56:     {
57:         $uri = Horde_String::lower($uri);
58:         if (isset($this->_strDTDURI[$uri])) {
59:             return $this->_strDTDURI[$uri];
60:         }
61:     }
62: 
63:     /**
64:      */
65:     public function registerDTD($publicIdentifier, $uri, $dtd)
66:     {
67:         $dtd->setDPI($publicIdentifier);
68: 
69:         $publicIdentifier = Horde_String::lower($publicIdentifier);
70: 
71:         $this->_strDTD[$publicIdentifier] = $dtd;
72:         $this->_strDTDURI[Horde_String::lower($uri)] = $dtd;
73:     }
74: }
75: 
API documentation generated by ApiGen