Пример #1
0
 protected function nodeToInstance(dom\node $node)
 {
     if ($node instanceof dom\handler) {
         $sNamespace = $node->getRoot()->getNamespace();
     } else {
         if ($node instanceof dom\element) {
             $sNamespace = $node->getNamespace();
         } else {
             $this->throwException(sprintf('Cannot convert %s to instance', $node->asToken()));
         }
     }
     if ($sNamespace == $this->getNamespace()) {
         $result = $node;
     } else {
         $result = $this->createTemplate($node);
     }
     return $result;
 }
Пример #2
0
 protected function parseChildrenOther(dom\node $node, array &$aResult)
 {
     switch ($node->getType()) {
         case $node::COMMENT:
             break;
         case $node::CDATA:
             $aResult[] = (string) $node;
             break;
         default:
             $this->throwException('Node type not allowed here', array($node->asToken()));
     }
 }