示例#1
0
 /**
  * Function: processInclude
  *
  * Returns true if the given node is an include directive and
  * executes the include by decoding the XML document. Returns
  * false if the given node is not an include directive.
  *
  * Parameters:
  *
  * dec - <mxCodec> that controls the encoding/decoding process.
  * node - XML node to be checked.
  * into - Optional object to pass-thru to the codec.
  */
 function processInclude($dec, $node, $into)
 {
     if ($node->nodeName == "include") {
         $name = $node->getAttribute("name");
         if (isset($name)) {
             try {
                 $xml = mxUtils::loadXmlDocument($name)->documentElement;
                 if (isset($xml)) {
                     $dec->decode($xml, $into);
                 }
             } catch (Exception $e) {
                 // ignore
             }
         }
         return true;
     }
     return false;
 }