1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154
|
<?php
/**
* $Horde: framework/XML_WBXML/WBXML/DTD.php,v 1.6.12.5 2006/03/11 09:55:01 jan Exp $
*
* From Binary XML Content Format Specification Version 1.3, 25 July 2001
* found at http://www.wapforum.org
*
* Copyright 2003-2006 Anthony Mills <amills@pyramid6.com>
*
* See the enclosed file COPYING for license information (LGPL). If you
* did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
*
* @package XML_WBXML
*/
class XML_WBXML_DTD {
var $version;
var $intTags;
var $intAttributes;
var $strTags;
var $strAttributes;
var $intCodePages;
var $strCodePages;
var $strCodePagesURI;
var $URI;
var $XMLNS;
var $DPI;
function XML_WBXML_DTD($v)
{
$this->version = $v;
$this->init();
}
function init()
{
}
function setAttribute($intAttribute, $strAttribute)
{
$this->strAttributes[$strAttribute] = $intAttribute;
$this->intAttributes[$intAttribute] = $strAttribute;
}
function setTag($intTag, $strTag)
{
$this->strTags[$strTag] = $intTag;
$this->intTags[$intTag] = $strTag;
}
function setCodePage($intCodePage, $strCodePage, $strCodePageURI)
{
$this->strCodePagesURI[$strCodePageURI] = $intCodePage;
$this->strCodePages[$strCodePage] = $intCodePage;
$this->intCodePages[$intCodePage] = $strCodePage;
}
function toTagStr($tag)
{
return isset($this->intTags[$tag]) ? $this->intTags[$tag] : false;
}
function toAttributeStr($attribute)
{
return isset($this->intTags[$attribute]) ? $this->intTags[$attribute] : false;
}
function toCodePageStr($codePage)
{
return isset($this->intCodePages[$codePage]) ? $this->intCodePages[$codePage] : false;
}
function toTagInt($tag)
{
return isset($this->strTags[$tag]) ? $this->strTags[$tag] : false;
}
function toAttributeInt($attribute)
{
return isset($this->strAttributes[$attribute]) ? $this->strAttributes[$attribute] : false;
}
function toCodePageInt($codePage)
{
return isset($this->strCodePages[$codePage]) ? $this->strCodePages[$codePage] : false;
}
function toCodePageURI($uri)
{
$uri = strtolower($uri);
if(!isset($this->strCodePagesURI[$uri])) {
die("unable to find codepage for $uri!\n");
}
$ret = isset($this->strCodePagesURI[$uri]) ? $this->strCodePagesURI[$uri] : false;
return $ret;
}
/**
* Getter for property version.
* @return Value of property version.
*/
function getVersion()
{
return $this->version;
}
/**
* Setter for property version.
* @param integer $v New value of property version.
*/
function setVersion($v)
{
$this->version = $v;
}
/**
* Getter for property URI.
* @return Value of property URI.
*/
function getURI()
{
return $this->URI;
}
/**
* Setter for property URI.
* @param string $u New value of property URI.
*/
function setURI($u)
{
$this->URI = $u;
}
/**
* Getter for property DPI.
* @return Value of property DPI.
*/
function getDPI()
{
return $this->DPI;
}
/**
* Setter for property DPI.
* @param DPI New value of property DPI.
*/
function setDPI($d)
{
$this->DPI = $d;
}
}
|