Copyright 2003-2016 Horde LLC (http://www.horde.org/) See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.
Author: Anthony Mills (amills@pyramid6.com)
Exemplo n.º 1
0
 public function changecodepage($uri)
 {
     // @todo: this is a hack!
     if ($this->_dtd->getVersion() == 2 && !preg_match('/1\\.2$/', $uri)) {
         $uri .= '1.2';
     }
     if ($this->_dtd->getVersion() == 1 && !preg_match('/1\\.1$/', $uri)) {
         $uri .= '1.1';
     }
     if ($this->_dtd->getVersion() == 0 && !preg_match('/1\\.0$/', $uri)) {
         $uri .= '1.0';
     }
     $cp = $this->_dtd->toCodePageURI($uri);
     if (strlen($cp)) {
         $this->_dtd = $this->_dtdManager->getInstanceURI($uri);
         if (!$this->_dtd) {
             throw new Horde_Xml_Wbxml_Exception('Unable to find dtd for ' . $uri);
         }
         $this->_output .= chr(Horde_Xml_Wbxml::GLOBAL_TOKEN_SWITCH_PAGE);
         $this->_output .= chr($cp);
     } else {
         $this->_subParser = new Horde_Xml_Wbxml_Encoder(true);
         $this->_subParserStack = 1;
     }
 }
Exemplo n.º 2
0
 public function switchAttributeCodePage($codePage)
 {
     $this->_attributeDTD = $this->_dtdManager->getInstance($this->_attributeDTD->toCodePageStr($codePage));
 }