home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2008 February / PCWFEB08.iso / Software / Resources / Developers / XAMPP 1.5.4 / Windows installer / xampp-win32-1.5.4-installer.exe / xampp / php / pear / XML / FastCreate.php < prev    next >
Encoding:
PHP Script  |  2005-12-02  |  19.9 KB  |  725 lines

  1. <?php
  2.  
  3. /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
  4.  
  5. /**
  6.  * Master file that defined the base structure for extended classes (drivers).
  7.  *
  8.  * This is the file included by the end-developper. The driver class needed is 
  9.  * automatically included.
  10.  *
  11.  * PHP versions 4 and 5
  12.  *
  13.  * LICENSE: This source file is subject to version 3.0 of the PHP license
  14.  * that is available through the world-wide-web at the following URI:
  15.  * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
  16.  * the PHP License and are unable to obtain it through the web, please
  17.  * send a note to license@php.net so we can mail you a copy immediately.
  18.  *
  19.  * @category   XML
  20.  * @package    XML_FastCreate
  21.  * @author     Guillaume Lecanu <Guillaume@dev.fr>
  22.  * @copyright  1997-2005 The PHP Group
  23.  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
  24.  * @version    CVS: $Id: FastCreate.php,v 1.5 2005/03/31 15:14:55 guillaume Exp $
  25.  * @link       http://pear.php.net/package/XML_FastCreate
  26.  * @see        XML_Tree
  27.  */
  28.  
  29. require_once 'PEAR.php';
  30.  
  31. // {{{ constants
  32.  
  33. /**
  34.  * Errors of XML_FastCreate
  35.  */
  36. define('XML_FASTCREATE_ERROR_NO_FACTORY', 1);
  37. define('XML_FASTCREATE_ERROR_NO_DRIVER', 2);
  38. define('XML_FASTCREATE_ERROR_DTD', 3);
  39.  
  40. /**
  41.  * Default filename for 'file' option
  42.  */
  43. define('XML_FASTCREATE_FILE', '/tmp/XML_FastCreate.xml');
  44.  
  45. /**
  46.  * Default program for 'exec' option
  47.  */
  48. define('XML_FASTCREATE_EXEC',
  49.     '/usr/bin/xmllint --valid --noout /tmp/XML_FastCreate.xml 2>&1');
  50.  
  51. /**
  52.  * DocType : XHTML 1.1
  53.  */
  54. define('XML_FASTCREATE_DOCTYPE_XHTML_1_1', 
  55.     '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" '
  56.     .'"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">');
  57.  
  58. /**
  59.  * DocType : XHTML 1.0 Strict
  60.  */
  61. define('XML_FASTCREATE_DOCTYPE_XHTML_1_0_STRICT',
  62.     '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" '
  63.     .'"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">');
  64.  
  65. /**
  66.  * DocType : XHTML 1.0 Transitional
  67.  */
  68. define('XML_FASTCREATE_DOCTYPE_XHTML_1_0_TRANSITIONAL',
  69.     '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" '
  70.     .'"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">');
  71.  
  72. /**
  73.  * DocType : XHTML 1.0 Frameset
  74.  */
  75. define('XML_FASTCREATE_DOCTYPE_XHTML_1_0_FRAMESET',
  76.     '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" '
  77.     .'"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">');
  78.  
  79. /**
  80.  * DocType : XHTML 4.01 Strict
  81.  */
  82. define('XML_FASTCREATE_DOCTYPE_HTML_4_01_STRICT',
  83.     '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" '
  84.     .'"http://www.w3.org/TR/html4/strict.dtd">');
  85.  
  86. /**
  87.  * DocType : XHTML 4.01 Transitional
  88.  */
  89. define('XML_FASTCREATE_DOCTYPE_HTML_4_01_Transitional',
  90.     '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" '
  91.     .'"http://www.w3.org/TR/html4/loose.dtd">');
  92.  
  93. /**
  94.  * DocType : XHTML 4.01 Frameset
  95.  */
  96. define('XML_FASTCREATE_DOCTYPE_HTML_4_01_Frameset',
  97.     '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" '
  98.     .'"http://www.w3.org/TR/html4/frameset.dtd">');
  99.  
  100. // }}}
  101.  
  102.  
  103.  
  104. /**
  105.  * Make a special class for overloading, depending of the PHP version.
  106.  * The class XML_FastCreate extend this special class 'XML_FastCreate_Overload'
  107.  */
  108. if (isSet($_GLOBALS['XML_FASTCREATE_NO_OVERLOAD']) 
  109.     && $_GLOBALS['XML_FASTCREATE_NO_OVERLOAD']) {
  110.     if (is_array($_GLOBALS['XML_FASTCREATE_NO_OVERLOAD'])) {
  111.         $class = 'class XML_FastCreate_Overload extends PEAR {';
  112.         foreach ($_GLOBALS['XML_FASTCREATE_NO_OVERLOAD'] as $tag) {
  113.             $class .= <<<TEXT
  114.             function $tag() { 
  115.                 \$args = func_get_args();
  116.                 array_unshift(\$args, '$tag');
  117.                 return call_user_func_array(array(&\$this, 'xml'), \$args);
  118.             }
  119. TEXT;
  120.         }
  121.         $class .= ' }';
  122.         eval($class);
  123.     } else {
  124.         class XML_FastCreate_Overload extends PEAR {}
  125.     }
  126. } else {
  127.     if (phpversion() < 5) {
  128.         $class = <<<TEXT
  129.         class XML_FastCreate_Overload extends PEAR {
  130.             function __call(\$method, \$args, &\$return)
  131.             {
  132.                 if (\$method != __CLASS__) {
  133.                     \$return = \$this->_call(\$method, \$args);
  134.                 }
  135.                 return true;
  136.             }
  137.         }
  138. TEXT;
  139.         eval($class);
  140.         if (function_exists('overload')) {
  141.             overload('XML_FastCreate_Overload');
  142.         }
  143.     } else {
  144.         $class = <<<TEXT
  145.         class XML_FastCreate_Overload extends PEAR {
  146.             function __call(\$method, \$args) 
  147.             {
  148.                 if (\$method != __CLASS__) {
  149.                     return \$this->_call(\$method, \$args);
  150.                 }
  151.             }
  152.         }
  153. TEXT;
  154.         eval($class);
  155.     }
  156. }
  157.  
  158.  
  159. // {{{ XML_FastCreate
  160.  
  161. /**
  162.  * Master class to used the XML_FastCreate application.
  163.  *
  164.  * The end-developper need to call the factory() method to make an instance :
  165.  *      $x =& XML_FastCreate::factory('Text');
  166.  * Simple example to make a valid XHTML page :
  167.  * <code>
  168.  * <?php
  169.  *  require_once 'XML/FastCreate.php';
  170.  *  $x =& XML_FastCreate::factory('Text');
  171.  *  $x->html(
  172.  *     $x->head(
  173.  *          $x->title("A simple XHTML page")
  174.  *     ),
  175.  *     $x->body(
  176.  *         $x->div(
  177.  *             $x->h1('Example'),
  178.  *             $x->br(),
  179.  *             $x->a(array('href' => 'http://pear.php.net'), 'PEAR WebSite')
  180.  *         )
  181.  *     )
  182.  *  );
  183.  *  // Write output
  184.  *  $x->toXML();
  185.  * ?>
  186.  * </code>
  187.  * KNOWN BUGS :
  188.  * - XML_DTD is an alpha version
  189.  *      - Some DTD couln't correctly interpreted (like XHTML 1.1)
  190.  *      - You can use an external program like XMLLINT for check validation
  191.  *
  192.  * PHP versions 4 and 5
  193.  *
  194.  * LICENSE: This source file is subject to version 3.0 of the PHP license
  195.  * that is available through the world-wide-web at the following URI:
  196.  * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
  197.  * the PHP License and are unable to obtain it through the web, please
  198.  * send a note to license@php.net so we can mail you a copy immediately.
  199.  *
  200.  * @category   XML
  201.  * @package    XML_FastCreate
  202.  * @author     Guillaume Lecanu <Guillaume@dev.fr>
  203.  * @copyright  1997-2005 The PHP Group
  204.  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
  205.  * @version    CVS: $Id: FastCreate.php,v 1.5 2005/03/31 15:14:55 guillaume Exp $
  206.  * @link       http://pear.php.net/package/XML_FastCreate
  207.  * @see        XML_Tree
  208.  */
  209. class XML_FastCreate extends XML_FastCreate_Overload 
  210. {
  211.     // {{{ properties
  212.     
  213.     /**
  214.     * DTD Filename for check validity of XML
  215.     *
  216.     * @var      string
  217.     * @access   private
  218.     */
  219.     var $_dtd;
  220.     
  221.     /**
  222.     * Enable / disable output indentation
  223.     *
  224.     * @var      boolean
  225.     * @access   private
  226.     */
  227.     var $_indent = false;
  228.  
  229.     /**
  230.     * Write output to a file
  231.     *
  232.     * @var      string
  233.     * @access   private
  234.     */
  235.     var $_file;
  236.     
  237.     /**
  238.     * Run external command after write output into file
  239.     *
  240.     * @var      string
  241.     * @access   private
  242.     */
  243.     var $_exec;
  244.     
  245.     /*
  246.     * Flag to know if the factory is used
  247.     *
  248.     * @var      boolean
  249.     * @access   private
  250.     */
  251.     var $_factory = false;
  252.     
  253.     /*
  254.     * Name of the driver use
  255.     *
  256.     * @var      string
  257.     * @access   private
  258.     */
  259.     var $_driver;
  260.     
  261.     /*
  262.     * List of tags replacements
  263.     *
  264.     * @var      array
  265.     * @access   private
  266.     */
  267.     var $_translate;
  268.     
  269.     /*
  270.     * List of entities to convert
  271.     *
  272.     * @var      array
  273.     * @access   private
  274.     */
  275.     var $_entities = array('&', '<', '>', '"', "'");
  276.     
  277.     /*
  278.     * List of replacement of entities
  279.     *
  280.     * @var      array
  281.     * @access   private
  282.     */
  283.     var $_replaces = array('&', '<', '>', '"', ''');
  284.         
  285.     /*
  286.     * String representation of the carriage return
  287.     *
  288.     * @var      string
  289.     * @access   public
  290.     */
  291.     var $cr;
  292.     
  293.     /*
  294.     * String representation of a tabulation
  295.     *
  296.     * @var      string
  297.     * @access   public
  298.     */
  299.     var $tab;
  300.     
  301.     // }}}
  302.     // {{{ factory()
  303.     
  304.     /**
  305.      * Factory : Make an instance of XML_FastCreate object
  306.      *
  307.      * @param string $driver    Driver to use ("Text", "XML_Tree"..)
  308.      *
  309.      * @param array $options    Hashtable of options :
  310.      *
  311.      *      'dtd' :         Set the DTD file to check validity
  312.      *                      [required the XML_DTD package]
  313.      *
  314.      *      'indent' :      Enable / disable output indentation
  315.      *
  316.      *      'version' :     Set the XML version (default = '1.0')
  317.      *
  318.      *      'encoding' :    Set the encoding charset (default = 'UTF-8')
  319.      *
  320.      *      'standalone' :  Set the standalone attribute (default = 'no')
  321.      *
  322.      *      'doctype'   :   DocType string, set manually or use :
  323.      *          XML_FASTCREATE_DOCTYPE_XHTML_1_1
  324.      *          XML_FASTCREATE_DOCTYPE_XHTML_1_0_STRICT
  325.      *          XML_FASTCREATE_DOCTYPE_XHTML_1_0_FRAMESET
  326.      *          XML_FASTCREATE_DOCTYPE_XHTML_1_0_TRANSITIONAL
  327.      *          XML_FASTCREATE_DOCTYPE_HTML_4_01_STRICT
  328.      *          XML_FASTCREATE_DOCTYPE_HTML_4_01_FRAMESET
  329.      *          XML_FASTCREATE_DOCTYPE_HTML_4_01_TRANSITIONAL
  330.      *
  331.      *      'quote' :       Auto quote attributes & contents (default = true)
  332.      *
  333.      *      'translate' :   Hashtable of tags to translate to anothers :
  334.      *                      'translate' => array(
  335.      *                          'title' => array('<h1 class="title"><span>', 
  336.      *                                          '</span></h1>'),
  337.      *                          'date'  => array('<span class="date">', 
  338.      *                                          '</span>'),
  339.      *                      )
  340.      *      
  341.      *      'exec' :        Use an external tool to valid the document
  342.      *
  343.      *      'file' :        Write the validation output to a file
  344.      *
  345.      *      'expand' :      Return single tag with the syntax : 
  346.      *                      <tag></tag> rather <tag /> (default = false)
  347.      *                      ( set to true if you write HTML )
  348.      *          
  349.      *      'apos' :        Quote apostrophe to ' (default = true) 
  350.      *                      <! WARNING !>
  351.      *                      For valid XML, you must let this option to true.
  352.      *                      If you write XHTML, Microsoft Internet Explorer 
  353.      *                      won't recognize this entitie, so you need to turn
  354.      *                      this option to false.
  355.      *
  356.      *      'singleAttribute' : Accept single attributes (default = false)
  357.      *                      ex: $x->input(array('type'=>'checkbox', 
  358.      *                              checked=>true))
  359.      *                      =>  <input type="checkbox" checked />
  360.      *                      <! WARNING !> 
  361.      *                      This syntax is not valid XML.
  362.      *                      For valid XML, don't use this option, use this :
  363.      *                      ex: $x->input(array('type'=>'checkbox', 
  364.      *                              checked=>'checked'))
  365.      *                      =>  <input type="checkbox" checked=>"checked" />
  366.      * 
  367.      * @return object       An XML_FastCreate_<driver> instance
  368.      * @access public
  369.      * @static
  370.      */
  371.     function &factory($driver, $options = array())
  372.     {
  373.         @include_once "FastCreate/{$driver}.php";
  374.         $class = 'XML_FastCreate_'.$driver;
  375.         if (!class_exists($class)) {
  376.             return PEAR::raiseError("Unable to include the XML/FastCreate/"
  377.                 .$driver.".php file.", XML_FASTCREATE_ERROR_NO_DRIVER, 
  378.                 PEAR_ERROR_DIE);
  379.         }
  380.         $obj = new $class($options);
  381.         return $obj;
  382.     }
  383.     // }}}
  384.     // {{{ XML_FastCreate()
  385.     
  386.     /**
  387.      * Constructor method. Use the factory() method to make an instance 
  388.      * 
  389.      * @param array $options    Hashtable of options. See factory() for details.
  390.      *
  391.      * @return object           An XML_FastCreate instance
  392.      * @access private
  393.      */
  394.     function XML_FastCreate($options = array())
  395.     {
  396.         if ($this->_factory) {
  397.         
  398.             $this->PEAR();
  399.             $this->_dtd = (isSet($options['dtd']) 
  400.                         ? $options['dtd'] : '');
  401.             $this->_file = (isSet($options['file']) 
  402.                         ? $options['file'] : '');
  403.             $this->_exec = (isSet($options['exec']) 
  404.                         ? $options['exec'] : '');
  405.             if (isSet($options['indent'])) {
  406.                 $this->_indent = $options['indent'];
  407.             }
  408.             if (isSet($options['translate'])) {
  409.                 $this->_translate = $options['translate'];
  410.             }
  411.             if ($this->_dtd) {
  412.                 include_once 'XML/DTD/XmlValidator.php';
  413.             }
  414.             if (!isSet($options['apos'])) {
  415.                 $options['apos'] = true;
  416.             }
  417.             if (!$options['apos']) {
  418.                 array_pop($this->_entities);
  419.                 array_pop($this->_replaces);
  420.             }
  421.             $this->cr  = chr(13).chr(10);
  422.             $this->tab = chr(9);
  423.  
  424.         } else {
  425.             PEAR::raiseError("Use the factory() method please.",
  426.                 XML_FASTCREATE_ERROR_NO_FACTORY, 
  427.                 PEAR_ERROR_DIE);
  428.         }
  429.     }
  430.     // }}}
  431.     // {{{ _call()
  432.     
  433.     /**
  434.      * Overloading management
  435.      * 
  436.      * @param string $method    Name of the function overloaded
  437.      * @param array $args       List of arguments of the function overloaded
  438.      * 
  439.      * @return mixed 
  440.      * @access private
  441.      */
  442.     function _call(&$method, &$args) 
  443.     {
  444.         array_unshift($args, $method);
  445.         return call_user_func_array(array(&$this, 'xml'), $args);
  446.     }
  447.     // }}}
  448.     // {{{ toXML()
  449.     
  450.     /**
  451.      * Print the current XML to standard output
  452.      *
  453.      * @return mixed    Return true or a PEAR Error object
  454.      * @access public
  455.      */
  456.     function toXML()
  457.     {
  458.         $xml = $this->getXML();
  459.         if ($this->_indent) {
  460.             $xml = $this->indentXML($xml);
  461.         }
  462.         print $xml;
  463.  
  464.         // Check Validity
  465.         if ($this->_dtd) {
  466.             return $this->isValid($xml);
  467.         }
  468.  
  469.         // Write output to file
  470.         if ($this->_file) {
  471.             $fp = fopen($this->_file, 'w+');
  472.             fwrite($fp, $xml);
  473.             fclose($fp);
  474.         }
  475.         
  476.         // Run an external program
  477.         if ($this->_exec) {
  478.            $return = shell_exec($this->_exec);
  479.            if ($return) {
  480.                 return PEAR::raiseError($return, XML_FASTCREATE_ERROR_DTD);
  481.            }
  482.         }
  483.  
  484.         return true;
  485.     }
  486.     // }}}
  487.     // {{{ isValid()
  488.  
  489.     /**
  490.      * Check if the XML respect the DTD.
  491.      * Require the XML_DTD package
  492.      *
  493.      * @param string $xml   The XML text to check
  494.      *
  495.      * @return boolean      Return true if valid
  496.      * @access public
  497.      */
  498.     function isValid(&$xml)
  499.     {
  500.         $validator = new XML_DTD_XmlValidator;
  501.         $tree = new XML_Tree();
  502.         $nodes = $tree->getTreeFromString($xml);
  503.         if (PEAR::isError($nodes)) {
  504.             return $nodes;
  505.         }
  506.         $parser =& new XML_DTD_Parser;
  507.         $validator->dtd = $parser->parse($this->_dtd);
  508.         $validator->_runTree($nodes);
  509.         if ($validator->_errors) {
  510.             $errors = $validator->getMessage();
  511.             return PEAR::raiseError($errors, XML_FASTCREATE_ERROR_DTD);
  512.         }
  513.         return true;
  514.     }
  515.     // }}}
  516.     // {{{ _quoteEntities()
  517.  
  518.     /**
  519.      * Replace XML special characters by their entities
  520.      *
  521.      * Convert :  &      <     >     "       '
  522.      *      To :  &  <  >  "  '
  523.      * 
  524.      * @param string $content   Content to be quoted
  525.      *
  526.      * @return string           The quoted content
  527.      * @access private
  528.      */
  529.     function _quoteEntities($content)
  530.     {
  531.         return str_replace($this->_entities, $this->_replaces, $content);
  532.     }
  533.     // }}}
  534.     // {{{ indentXML()
  535.  
  536.     /**
  537.      * Indent an XML text 
  538.      *
  539.      * @param string $xml   XML text to indent
  540.      * 
  541.      * @return string       The XML text indented
  542.      * @acess public
  543.      */
  544.     function indentXML($xml)
  545.     {
  546.         require_once "XML/Beautifier.php";
  547.         $fmt = new XML_Beautifier();
  548.         $out =& $fmt->formatString($xml);
  549.         return $out;
  550.     }
  551.     // }}}
  552.     // {{{ xml()
  553.     
  554.     /** 
  555.      *  Make an XML tag.
  556.      *
  557.      *  Accept all forms of parameters.
  558.      *
  559.      * @param string $tag       Name of the tag
  560.      * @param array $args       Optional list for attributes
  561.      * @param array $contents   Optional list of contents (strings or sub tags)
  562.      *
  563.      * @return mixed            See the driver specification
  564.      * @access public
  565.      */
  566.     function xml($tag) 
  567.     {
  568.         $attribs = array();
  569.         $args = func_get_args();
  570.         array_shift($args);
  571.         if ((count($args) > 0) && is_array($args[0])) {
  572.             $attribs = $args[0];
  573.             array_shift($args);
  574.         }
  575.         if ($tag{0} == '_') {
  576.             $tag = substr($tag, 1);
  577.         } else {
  578.         
  579.             if (isSet($this->_translate[$tag])) {
  580.                 if (isSet($this->_translate[$tag][1])) {
  581.                     $open  =& $this->_translate[$tag][0];
  582.                     $close =& $this->_translate[$tag][1];
  583.                 } elseif (isSet($this->_translate[$tag][0])) {
  584.                     $open  = '<'.$this->_translate[$tag][0].'>';
  585.                     $close = '</'.$this->_translate[$tag][0].'>';
  586.                 } else {
  587.                     $open  = '<div class="'.$tag.'">';
  588.                     $close = '</div>';
  589.                 }
  590.                 return $this->importXML($open.$this->exportXML($args).$close);
  591.             } 
  592.         }
  593.         return $this->makeXML($tag, $attribs, $args);
  594.     }
  595.     // }}}
  596.  
  597.  
  598.     // -------------------------------------------------------- \\
  599.     // --- Abstract methods to be implemented by the driver --- \\
  600.     // -------------------------------------------------------- \\
  601.  
  602.     // {{{ makeXML()
  603.     
  604.     /**
  605.      * Make an XML Tag 
  606.      *
  607.      * @param string $tag       Name of the tag
  608.      * @param array $attribs    List of attributes
  609.      * @param array $contents   List of contents (strings or sub tags)
  610.      * 
  611.      * @return mixed            See the driver specifications
  612.      * @access public
  613.      */
  614.     function makeXML($tag, $attribs = array(), $contents = array()) 
  615.     {
  616.     }
  617.     // }}}
  618.     // {{{ quote()
  619.     
  620.     /**
  621.      * Encode a string to be include in XML tags.
  622.      *
  623.      * To use only if the 'quoteContents' is false
  624.      * Convert :  &      <     >     "       '
  625.      *      To :  &  <  >  "  '
  626.      * 
  627.      * @param string $content   Content to be quoted
  628.      *
  629.      * @return string           The quoted content
  630.      * @access public
  631.      */
  632.     function quote($content) 
  633.     {
  634.     }
  635.     // }}}
  636.     // {{{ noquote()
  637.  
  638.     /**
  639.      * Don't quote this content.
  640.      *
  641.      * To use only if the 'quoteContents' is true
  642.      * 
  643.      * @param string $content   Content to escape quoting
  644.      *
  645.      * @return string           The content not quoted
  646.      * @access public
  647.      */
  648.     function noquote($content) 
  649.     {
  650.     }
  651.     // }}}
  652.     // {{{ comment()
  653.  
  654.     /**
  655.      * Make an XML comment
  656.      *
  657.      * @param mixed $content    Content to comment
  658.      * 
  659.      * @return mixed            See the driver specifications
  660.      * @access public
  661.      */
  662.     function comment($content) 
  663.     {
  664.     }
  665.     // }}}
  666.     // {{{ cdata()
  667.  
  668.     /**
  669.      * Make a CDATA section <![CDATA[ (...) ]]>
  670.      *
  671.      * @param mixed $content    Content of the section
  672.      * 
  673.      * @return mixed            See the driver specifications
  674.      * @access public
  675.      */
  676.     function cdata($content) 
  677.     {
  678.     }
  679.     // }}}
  680.     // {{{ getXML()
  681.  
  682.     /**
  683.      * Return the current XML text 
  684.      *
  685.      * @return string           The current XML text
  686.      * @access public
  687.      */
  688.     function getXML() 
  689.     {
  690.     }
  691.     // }}}
  692.     // {{{ importXML()
  693.  
  694.     /**
  695.      * Import XML text to driver data
  696.      *
  697.      * @param mixed $xml        The XML text
  698.      * 
  699.      * @return mixed            See the driver specifications
  700.      * @access public
  701.      */
  702.     function importXML($xml) 
  703.     {
  704.     }
  705.     // }}}
  706.     // {{{ exportXML()
  707.  
  708.     /**
  709.      * Export driver data to XML text
  710.      *
  711.      * @param mixed $xml        The XML data driver 
  712.      * 
  713.      * @return string           The XML text
  714.      * @access public
  715.      */
  716.     function exportXML($xml) 
  717.     {
  718.     }
  719.     // }}}
  720.  
  721. }
  722. // }}}
  723.  
  724. ?>
  725.