PHP DOMNode Code Examples

This page contains top rated real world PHP examples of DOMNode extracted from open source projects. You can rate examples to help us improve the quality of examples
Example #1
Show file File: NameIDFormat.php Project: LearnerNation/lightsaml
0
 /**
  * @param \DOMNode $parent
  * @param SerializationContext $context
  * @return \DOMElement
  */
 public function getXml(\DOMNode $parent, SerializationContext $context)
 {
     $result = $context->getDocument()->createElementNS(Protocol::NS_METADATA, 'md:NameIDFormat');
     $parent->appendChild($result);
     $result->nodeValue = $this->value;
     return $result;
 }
Example #2
Show file File: Envi.php Project: difra-org/difra
0
 /**
  * Get some configuration variables as XML node attributes
  * @param \DOMElement|\DOMNode $node
  */
 public static function getStateXML($node)
 {
     $config = self::getState();
     foreach ($config as $k => $v) {
         $node->setAttribute($k, $v);
     }
 }
Example #3
Show file File: attribute_translator.cls.php Project: fredcido/simuweb
0
 static function append_style(DOMNode $node, $new_style)
 {
     $style = rtrim($node->getAttribute(self::$_style_attr), ";");
     $style .= $new_style;
     $style = ltrim($style, ";");
     $node->setAttribute(self::$_style_attr, $style);
 }
Example #4
Show file File: Date.php Project: gauthierm/xml-atom
0
 /**
  * Builds and creates the Atom XML nodes required by this date
  *
  * The element node representing this date is created separately and
  * passed as the first parameter of this method.
  *
  * @param DOMNode $node the node representing this date.
  *
  * @return void
  */
 protected function _buildNode(DOMNode $node)
 {
     $document = $node->ownerDocument;
     $date_string = $this->_date->format('c');
     $text_node = $document->createTextNode($date_string);
     $node->appendChild($text_node);
 }
Example #5
Show file File: Parser.php Project: buga1234/buga_segforours
0
 /**
  * Converts a node to a PHP value
  *
  * @param DOMNode $node
  * @return mixed
  */
 private static function _nodeToValue($node)
 {
     $type = null;
     if ($node instanceof DOMElement) {
         $type = $node->getAttribute('type');
     }
     switch ($type) {
         case 'datetime':
             return self::_timestampToUTC((string) $node->nodeValue);
         case 'date':
             return new DateTime((string) $node->nodeValue);
         case 'integer':
             return (int) $node->nodeValue;
         case 'boolean':
             $value = (string) $node->nodeValue;
             if (is_numeric($value)) {
                 return (bool) $value;
             } else {
                 return $value !== "true" ? false : true;
             }
         case 'array':
         case 'collection':
             return self::_nodeToArray($node);
         default:
             if ($node->hasChildNodes()) {
                 return self::_nodeToArray($node);
             } elseif (trim($node->nodeValue) === '') {
                 return null;
             } else {
                 return $node->nodeValue;
             }
     }
 }
Example #6
Show file File: Module.Class.php Project: nathanfl/medtele
0
	private function processDataTag( DOMNode $node ) {
		if( $node->hasAttribute( DATA_TYPE_ATTRIBUTE_NAME ) ) {
			switch( $node->getAttribute( DEPENDENCY_TYPE_ATTRIBUTE_NAME ) ) {
				case DATA_TYPE_STREAM_VALUE:
				/******* nothing for now
					$url = $this->buildURL( MODULE_STREAM_PATH . $node->nodeValue );
					if( $this->url_exists( $url ) ) {
						$this->xml->load( $url );
					}
				**********/
					break;
				case DATA_TYPE_PROCESSOR_VALUE:

					break;
				case DATA_TYPE_DYNAMICFILE_VALUE:
					if ( file_exists( MODULE_FILE_PATH . $node->nodeValue ) ) {
						ob_start();
						$file = MODULE_FILE_PATH . $node->nodeValue;
						include $file;
						$this->dynamicFileOutput .= ob_get_contents();
						ob_end_clean();
					}
					break;
				case DATA_TYPE_STATICFILE_VALUE:
					if ( file_exists( MODULE_FILE_PATH . $node->nodeValue ) ) {
						$this->staticFileOutput .= file_get_contents( MODULE_FILE_PATH . $node->nodeValue );
					} else {
						
						//echo "loading: " . MODULE_FILE_PATH . $node->nodeValue;
					}
					break;
			}
		}
	}
Example #7
Show file File: LayoutRepository.php Project: gobjila/BackBee
0
 /**
  * Draw a final layout zone on its thumbnail.
  *
  * @access private
  *
  * @param ressource $thumbnail  The thumbnail ressource
  * @param DOMNode   $node       The current node zone
  * @param array     $clip       The clip rect to draw
  * @param int       $background The background color
  * @param int       $gridcolumn The number of columns in the grid
  * @param boolean   $lastChild  True if the current node is the last child of its parent node
  *
  * @return int The new X axis position;
  */
 private function drawThumbnailZone(&$thumbnail, $node, $clip, $background, $gridcolumn, $lastChild = false)
 {
     $x = $clip[0];
     $y = $clip[1];
     $width = $clip[2];
     $height = $clip[3];
     if (null !== ($spansize = preg_replace('/[^0-9]+/', '', $node->getAttribute('class')))) {
         $width = floor($width * $spansize / $gridcolumn);
     }
     if (false !== strpos($node->getAttribute('class'), 'Child')) {
         $height = floor($height / 2);
     }
     if (!$node->hasChildNodes()) {
         $this->drawRect($thumbnail, array($x, $y, $width, $height), $background, $width == $clip[2] || strpos($node->getAttribute('class'), 'hChild'), $lastChild);
         return $width + 2;
     }
     foreach ($node->childNodes as $child) {
         if (is_a($child, 'DOMText')) {
             continue;
         }
         if ('clear' == $child->getAttribute('class')) {
             $x = $clip[0];
             $y = $clip[1] + floor($height / 2) + 2;
             continue;
         }
         $x += $this->drawThumbnailZone($thumbnail, $child, array($x, $y, $clip[2], $height), $background, $gridcolumn, $node->isSameNode($node->parentNode->lastChild));
     }
     return $x + $width - 2;
 }
Example #8
Show file File: index.php Project: ErikRoelofs/wordcounter
0
function recursiveStripQuotes(DOMNode $node)
{
    if (!$node->childNodes) {
        return;
    }
    $purge = array();
    foreach ($node->childNodes as $child) {
        $class = null;
        if ($child->attributes) {
            $class = $child->attributes->getNamedItem('class');
        }
        if ($class && $class->value == 'quoteheader') {
            $purge[] = $child;
        } elseif ($class && $class->value == 'quotefooter') {
            $purge[] = $child;
        } elseif ($child->nodeName == 'blockquote') {
            $purge[] = $child;
        } else {
            recursiveStripQuotes($child);
        }
    }
    foreach ($purge as $child) {
        $node->removeChild($child);
    }
    return $node;
}
Example #9
Show file File: SignatureCreator.php Project: LearnerNation/lightsaml
0
 /**
  * @param \DOMNode $parent
  * @param \AerialShip\LightSaml\Meta\SerializationContext $context
  * @return \DOMNode
  */
 function getXml(\DOMNode $parent, SerializationContext $context)
 {
     $objXMLSecDSig = new \XMLSecurityDSig();
     $objXMLSecDSig->setCanonicalMethod($this->getCanonicalMethod());
     $key = $this->getXmlSecurityKey();
     switch ($key->type) {
         case \XMLSecurityKey::RSA_SHA256:
             $type = \XMLSecurityDSig::SHA256;
             break;
         case \XMLSecurityKey::RSA_SHA384:
             $type = \XMLSecurityDSig::SHA384;
             break;
         case \XMLSecurityKey::RSA_SHA512:
             $type = \XMLSecurityDSig::SHA512;
             break;
         default:
             $type = \XMLSecurityDSig::SHA1;
     }
     $objXMLSecDSig->addReferenceList(array($parent), $type, array(Protocol::XMLSEC_TRANSFORM_ALGORITHM_ENVELOPED_SIGNATURE, \XMLSecurityDSig::EXC_C14N), array('id_name' => $this->getIDName(), 'overwrite' => FALSE));
     $objXMLSecDSig->sign($key);
     $objXMLSecDSig->add509Cert($this->getCertificate()->getData(), false, false);
     $firstChild = $parent->hasChildNodes() ? $parent->firstChild : null;
     if ($firstChild && $firstChild->localName == 'Issuer') {
         // The signature node should come after the issuer node
         $firstChild = $firstChild->nextSibling;
     }
     $objXMLSecDSig->insertSignature($parent, $firstChild);
 }
Example #10
Show file File: CheckExternalLinksTask.php Project: govtnz/silverstripe-externallinks
0
 /**
  * Check the status of a single link on a page
  *
  * @param BrokenExternalPageTrack $pageTrack
  * @param DOMNode $link
  */
 protected function checkPageLink(BrokenExternalPageTrack $pageTrack, DOMNode $link)
 {
     $class = $link->getAttribute('class');
     $href = $link->getAttribute('href');
     $markedBroken = preg_match('/\\b(ss-broken)\\b/', $class);
     // Check link
     $httpCode = $this->linkChecker->checkLink($href);
     if ($httpCode === null) {
         return;
     }
     // Null link means uncheckable, such as an internal link
     // If this code is broken then mark as such
     if ($foundBroken = $this->isCodeBroken($httpCode)) {
         // Create broken record
         $brokenLink = new BrokenExternalLink();
         $brokenLink->Link = $href;
         $brokenLink->HTTPCode = $httpCode;
         $brokenLink->TrackID = $pageTrack->ID;
         $brokenLink->StatusID = $pageTrack->StatusID;
         // Slight denormalisation here for performance reasons
         $brokenLink->write();
     }
     // Check if we need to update CSS class, otherwise return
     if ($markedBroken == $foundBroken) {
         return;
     }
     if ($foundBroken) {
         $class .= ' ss-broken';
     } else {
         $class = preg_replace('/\\s*\\b(ss-broken)\\b\\s*/', ' ', $class);
     }
     $link->setAttribute('class', trim($class));
 }
Example #11
Show file File: tag-stripper.php Project: zmwebdev/PHPcookbook-code-3ed
0
 protected function copyNodes(DOMNode $dirty, DOMNode $clean)
 {
     foreach ($dirty->attributes as $name => $valueNode) {
         /* Copy over allowed attributes */
         if (isset($this->allowed[$dirty->nodeName][$name])) {
             $attr = $clean->ownerDocument->createAttribute($name);
             $attr->value = $valueNode->value;
             $clean->appendChild($attr);
         }
     }
     foreach ($dirty->childNodes as $child) {
         /* Copy allowed elements */
         if ($child->nodeType == XML_ELEMENT_NODE && isset($this->allowed[$child->nodeName])) {
             $node = $clean->ownerDocument->createElement($child->nodeName);
             $clean->appendChild($node);
             /* Examine children of this allowed element */
             $this->copyNodes($child, $node);
         } else {
             if ($child->nodeType == XML_TEXT_NODE) {
                 $text = $clean->ownerDocument->createTextNode($child->textContent);
                 $clean->appendChild($text);
             }
         }
     }
 }
Example #12
Show file File: PaymentAccount.php Project: zerve/omnipay-elementexpress
0
 public function appendToDom(\DOMNode $parent)
 {
     $node = $parent->appendChild(new \DOMElement('PaymentAccount'));
     $node->appendChild(new \DOMElement('PaymentAccountID', $this['PaymentAccountID']));
     $node->appendChild(new \DOMElement('PaymentAccountType', $this['PaymentAccountType']));
     $node->appendChild(new \DOMElement('PaymentAccountReferenceNumber', $this['PaymentAccountReferenceNumber']));
 }
Example #13
Show file File: CCDADomDocument.class.php Project: fbone/mediboard4
0
 /**
  * Caste l'élement spécifié
  *
  * @param DOMNode $nodeParent DOMNode
  * @param String  $value      String
  *
  * @return void
  */
 function castElement($nodeParent, $value)
 {
     $value = utf8_encode($value);
     $attribute = $this->createAttributeNS("http://www.w3.org/2001/XMLSchema-instance", "xsi:type");
     $attribute->nodeValue = $value;
     $nodeParent->appendChild($attribute);
 }
Example #14
Show file File: DOM.php Project: difra-org/difra
0
 /**
  * Add dom attributes from array
  * @static
  * @param \DOMElement|\DOMNode $node
  * @param array $array
  * @param bool $verbal
  */
 public static function array2domAttr(&$node, $array, $verbal = false)
 {
     if (is_array($array) and !empty($array)) {
         foreach ($array as $k => $v) {
             if (is_numeric($k) and !is_array($v) and !is_object($v) and ctype_alnum($v)) {
                 $node->appendChild($node->ownerDocument->createElement(ctype_alpha($v[0]) ? $v : "_{$v}"));
             } elseif (is_array($v)) {
                 if (is_numeric($k)) {
                     $k = "_{$k}";
                 }
                 $newNode = $node->appendChild($node->ownerDocument->createElement($k));
                 self::array2domAttr($newNode, $v, $verbal);
             } elseif (is_object($v)) {
             } else {
                 if ($verbal) {
                     if (is_null($v)) {
                         $v = 'null';
                     } elseif ($v === false) {
                         $v = 'false';
                     } elseif ($v === true) {
                         $v = 'true';
                     } elseif ($v === 0) {
                         $v = '0';
                     }
                 }
                 $node->setAttribute(ctype_alpha($k[0]) ? $k : "_{$k}", $v);
             }
         }
     }
 }
Example #15
Show file File: XmlDataSource.php Project: helpfulrobot/chrisahhh-silverstripe-importer
0
 /**
  * @param DOMNode $node
  * @param ProxyObject $proxy
  */
 private function process(DOMNode $node, ProxyObject $proxy)
 {
     $proxy->setName($node->nodeName);
     if ($node->hasAttributes()) {
         for ($i = 0; $i < $node->attributes->length; $i++) {
             $attribute = $node->attributes->item($i);
             $proxy->set($attribute->name, $attribute->value);
         }
     }
     if ($node->hasChildNodes()) {
         $nodeTypes = array();
         foreach ($node->childNodes as $childNode) {
             if ($childNode->nodeName === '#text') {
                 $proxy->setValue($childNode->nodeValue);
             } else {
                 $childProxy = new ProxyObject();
                 $this->process($childNode, $childProxy);
                 $nodeTypes[$childProxy->getName()][] = $childProxy;
             }
         }
         foreach ($nodeTypes as $tagName => $nodes) {
             $proxy->set($tagName, $nodes);
         }
     }
 }
Example #16
Show file File: Card.php Project: zerve/omnipay-elementexpress
0
 public function appendToDom(\DOMNode $parent)
 {
     $node = $parent->appendChild(new \DOMElement('Card'));
     // Append parameters.
     $node->appendChild(new \DOMElement('CVV', $this['CVV']));
     // Only one of the following field groups needs to be included; If more
     // than one is present, they will be given the following order of
     // precedence. To avoid unintended results only populate one field per
     // transaction.
     $cardData = ['MagneprintData' => false, 'EncryptedTrack2Data' => true, 'EncryptedTrack1Data' => true, 'EncryptedCardData' => true, 'Track2Data' => false, 'Track1Data' => false];
     do {
         foreach ($cardData as $field => $isEncrypted) {
             if (!empty($this[$field])) {
                 $node->appendChild(new \DOMElement($field, strtoupper($this[$field])));
                 if ($isEncrypted) {
                     $node->appendChild(new \DOMElement('CardDataKeySerialNumber', strtoupper($this['CardDataKeySerialNumber'])));
                     $node->appendChild(new \DOMElement('EncryptedFormat', $this['EncryptedFormat']));
                 }
                 break 2;
             }
         }
         if (!empty($this['CardNumber'])) {
             $node->appendChild(new \DOMElement('CardNumber', $this['CardNumber']));
         }
         if (!empty($this['ExpirationMonth']) && !empty($this['ExpirationYear'])) {
             $time = gmmktime(0, 0, 0, $this['ExpirationMonth'], 1, $this['ExpirationYear']);
             $node->appendChild(new \DOMElement('ExpirationMonth', gmdate('m', $time)));
             $node->appendChild(new \DOMElement('ExpirationYear', gmdate('y', $time)));
         }
     } while (false);
 }
Example #17
Show file File: menu.php Project: difra-org/difra
0
 /**
  * @param \DOMNode|\DOMElement $node
  * @param int $menuId
  */
 private function getEditXML($node, $menuId)
 {
     $menu = \Difra\Plugins\CMS\Menu::get($menuId);
     $node->setAttribute('depth', $menu->getDepth());
     $parentsNode = $node->appendChild($this->xml->createElement('parents'));
     \Difra\Plugins\CMS::getInstance()->getMenuItemsXML($parentsNode, $menu->getId());
 }
Example #18
Show file File: TableElement.php Project: nicholasryan/CorePlus
0
	/**
	 * Parse through a child node of this table, usually a tr, thead, or tbody.
	 *
	 * This is a recursive safe function.
	 *
	 * @param \DOMNode $node
	 */
	private function _parseInto(\DOMNode $node){
		if($node->hasChildNodes()){
			$nodes = $node->childNodes;
			for($i = 0; $i < $nodes->length; $i++){
				/** @var \DOMNode $node */
				$node = $nodes->item($i);
				$nodeType = $node->nodeName;

				switch($nodeType){
					case 'tr':
						// Increment to the next row on a TR tag!
						++$this->_currentRow;
						$this->_currentCol = 0;
						$this->_parseInto($node);
						break;
					case 'thead':
					case 'tbody':
						// These simply get parsed again for TR tags.
						$this->_parseInto($node);
						break;
					case 'td':
					case 'th':
						$this->_parseCell($node);
						break;
				}
			}
		}
	}
Example #19
Show file File: Content.php Project: gauthierm/xml-atom
0
 /**
  * Builds and creates the Atom XML nodes required by this content
  *
  * The element node representing this content is created separately and
  * passed as the first parameter of this method.
  *
  * The text content of this content is created as a CDATA section.
  *
  * @param DOMNode $node the node representing this content. Extra nodes
  *                      should be created and added to this node.
  *
  * @return void
  */
 protected function _buildNode(DOMNode $node)
 {
     $document = $node->ownerDocument;
     $node->setAttributeNS(XML_Atom_Node::NS, 'type', $this->_type);
     $cdata_node = $document->createCDATASection($this->_text);
     $node->appendChild($cdata_node);
 }
Example #20
Show file File: AutorizaRetorno.php Project: phpnfe/nfe
0
 /**
  * Retorna a chave de 44 caracteres da nfe.
  *
  * @return string
  */
 public function getChNFe()
 {
     if ($this->isError()) {
         return '';
     }
     return $this->infProt->getElementsByTagName('chNFe')->item(0)->textContent;
 }
Example #21
Show file File: SubField.php Project: navtis/xerxes
0
 /**
  * Create a MARC Sub Field
  * 
  * @param \DOMNode $node
  */
 public function __construct(\DOMNode $node = null)
 {
     if ($node != null) {
         $this->code = $node->getAttribute("code");
         $this->value = $node->nodeValue;
     }
 }
Example #22
Show file File: ezpagetype.php Project: brookinsconsulting/ezecosystem
0
 /**
  * Unserialize contentclass attribute
  *
  * @param eZContentClassAttribute $classAttribute
  * @param DOMNode $attributeNode
  * @param DOMNode $attributeParametersNode
  */
 function unserializeContentClassAttribute($classAttribute, $attributeNode, $attributeParametersNode)
 {
     $defaultZoneLayout = $attributeParametersNode->getElementsByTagName('default-layout')->item(0)->textContent;
     if ($defaultZoneLayout !== false) {
         $classAttribute->setAttribute(self::DEFAULT_ZONE_LAYOUT_FIELD, $defaultZoneLayout);
     }
 }
Example #23
Show file File: Ezer_XmlVariable.php Project: codegooglecom/ezerphp
0
 public function parse(DOMNode $element)
 {
     if ($element->hasAttribute('name')) {
         $this->name = $element->getAttribute('name');
     }
     if ($element->hasAttribute('type')) {
         $this->type = $element->getAttribute('type');
     }
     for ($i = 0; $i < $element->childNodes->length; $i++) {
         $childElement = $element->childNodes->item($i);
         if ($childElement->parentNode !== $element) {
             continue;
         }
         if ($childElement instanceof DOMComment || $childElement instanceof DOMText) {
             continue;
         }
         switch ($childElement->nodeName) {
             case 'part':
                 $this->parts[] = new Ezer_XmlVariable($childElement);
                 break;
             default:
                 throw new Ezer_XmlPersistanceElementNotMappedException($childElement->nodeName);
         }
     }
 }
Example #24
Show file File: entry.php Project: difra-org/difra
0
 /**
  * @param \DOMNode $node
  */
 protected function postProcessXML($node)
 {
     // дата релиза
     if (!is_null($this->release)) {
         $release = date('d-m-Y', strtotime($this->release . ' 00:00:00'));
         $node->setAttribute('release', $release);
         $xDate = explode('-', $release);
         $fullDate = $xDate[0] . ' ' . \Difra\Locales::getInstance()->getXPath('portfolio/months/m_' . $xDate[1]) . ' ' . $xDate[2];
         $node->setAttribute('fullDate', $fullDate);
     }
     // авторы
     if (!is_null($this->authors)) {
         $authorsArray = unserialize($this->authors);
         if (!empty($authorsArray)) {
             foreach ($authorsArray as $k => $data) {
                 if (isset($data['role'])) {
                     $roleNode = $node->appendChild($node->ownerDocument->createElement('role'));
                     $roleNode->setAttribute('name', $data['role']);
                     if (isset($data['contibutors']) && is_array($data['contibutors'])) {
                         foreach ($data['contibutors'] as $cName) {
                             $cNode = $roleNode->appendChild($node->ownerDocument->createElement('contibutor'));
                             $cNode->setAttribute('name', $cName);
                         }
                     }
                 }
             }
         }
     }
 }
Example #25
Show file File: Application.php Project: zerve/omnipay-elementexpress
0
 public function appendToDom(\DOMNode $parent)
 {
     $node = $parent->appendChild(new \DOMElement('Application'));
     $node->appendChild(new \DOMElement('ApplicationID', $this['ApplicationID']));
     $node->appendChild(new \DOMElement('ApplicationName', $this['ApplicationName']));
     $node->appendChild(new \DOMElement('ApplicationVersion', $this['ApplicationVersion']));
 }
Example #26
Show file File: commerceML2Splitter.php Project: BGCX261/zimmerli-svn-to-git
0
 protected function __collectGroup(DOMDocument $v9a09b4dfda82e3e665e31092d1c3ec8d, DOMNode $v1471e4e05a4db95d353cc867fe317314, DOMNode $vdb0f6f37ebeb6ea09489124345af2a45)
 {
     $v3d788fa62d7c185a1bee4c9147ee1091 = new DOMXPath($v9a09b4dfda82e3e665e31092d1c3ec8d);
     $vb8d7f0a7b1f89a0e2689069b9ead837d = $vdb0f6f37ebeb6ea09489124345af2a45->getElementsByTagName("Ид");
     $v00655e48bd78b9fefe2ba39b753dd932 = $vdb0f6f37ebeb6ea09489124345af2a45->getElementsByTagName("Наименование");
     $vb80bb7740288fda1f201890375a60c8f = $vb8d7f0a7b1f89a0e2689069b9ead837d->item(0)->nodeValue;
     $vb068931cc450442b63f5b3d276ea4297 = $v00655e48bd78b9fefe2ba39b753dd932->item(0)->nodeValue;
     $vc772070e479ef7642e1f6b1620b703ab = $v3d788fa62d7c185a1bee4c9147ee1091->evaluate(".//Группа[Ид='{$vb80bb7740288fda1f201890375a60c8f}']", $v1471e4e05a4db95d353cc867fe317314);
     if ($vc772070e479ef7642e1f6b1620b703ab instanceof DOMNodeList && $vc772070e479ef7642e1f6b1620b703ab->length) {
         return $vc772070e479ef7642e1f6b1620b703ab->item(0);
     }
     $v1722ade329f7d0765de2a5d5cf04b3e6 = $v9a09b4dfda82e3e665e31092d1c3ec8d->createElement('Группа');
     $v1722ade329f7d0765de2a5d5cf04b3e6->appendChild($v9a09b4dfda82e3e665e31092d1c3ec8d->createElement('Ид', $vb80bb7740288fda1f201890375a60c8f));
     $v1722ade329f7d0765de2a5d5cf04b3e6->appendChild($v9a09b4dfda82e3e665e31092d1c3ec8d->createElement('Наименование', $vb068931cc450442b63f5b3d276ea4297));
     $vd0e45878043844ffc41aac437e86b602 = $vdb0f6f37ebeb6ea09489124345af2a45->parentNode ? $vdb0f6f37ebeb6ea09489124345af2a45->parentNode->parentNode : false;
     if ($vd0e45878043844ffc41aac437e86b602 && $vd0e45878043844ffc41aac437e86b602->nodeName == "Группа") {
         $v8040a7de679c140285d7b0ca689dadc5 = $this->__collectGroup($v9a09b4dfda82e3e665e31092d1c3ec8d, $v1471e4e05a4db95d353cc867fe317314, $vd0e45878043844ffc41aac437e86b602);
         $vecc14ae322be7f2622dee4a101209ee9 = $v8040a7de679c140285d7b0ca689dadc5->childNodes->item(2);
         if (!$vecc14ae322be7f2622dee4a101209ee9) {
             $vecc14ae322be7f2622dee4a101209ee9 = $v8040a7de679c140285d7b0ca689dadc5->appendChild($v9a09b4dfda82e3e665e31092d1c3ec8d->createElement("Группы"));
         }
         $vecc14ae322be7f2622dee4a101209ee9->appendChild($v1722ade329f7d0765de2a5d5cf04b3e6);
     } else {
         $v1471e4e05a4db95d353cc867fe317314->appendChild($v1722ade329f7d0765de2a5d5cf04b3e6);
     }
     return $v1722ade329f7d0765de2a5d5cf04b3e6;
 }
Example #27
Show file File: radio.php Project: difra-org/difra
0
 /**
  * Возвращает список каналов по трекам в XML
  * @param array $tracks
  * @param \DOMNode $node
  * @return void
  */
 public function getTracksChannelsXML($tracks, $node)
 {
     $db = \Difra\MySQL::getInstance();
     $tracks = array_map('intval', $tracks);
     $channelsXML = $node->appendChild($node->ownerDocument->createElement('tracksInChannels'));
     $db->fetchXML($channelsXML, "SELECT `id`, `channel` FROM `radio_tracks` WHERE `id` IN (" . implode(', ', $tracks) . ")");
 }
Example #28
Show file File: ControlField.php Project: fresnostate-library/xerxes
0
 /**
  * Create a MARC Control Field
  * 
  * @param \DOMNode $objNode
  */
 public function __construct(\DOMNode $objNode = null)
 {
     if ($objNode != null) {
         $this->tag = $objNode->getAttribute("tag");
         $this->value = $objNode->nodeValue;
     }
 }
Example #29
Show file
0
 /**
  * Convert node oto array
  *
  * @param \DOMNode $node
  * @param string $path
  * @return array|string|null
  *
  * @SuppressWarnings(PHPMD.CyclomaticComplexity)
  */
 protected function _convertNode(\DOMNode $node, $path = '')
 {
     $output = array();
     if ($node->nodeType == XML_ELEMENT_NODE) {
         if ($node->hasAttributes()) {
             $backendModel = $node->attributes->getNamedItem('backend_model');
             if ($backendModel) {
                 $this->_metadata[$path] = array('backendModel' => $backendModel->nodeValue);
             }
         }
         $nodeData = array();
         /** @var $childNode \DOMNode */
         foreach ($node->childNodes as $childNode) {
             $childrenData = $this->_convertNode($childNode, ($path ? $path . '/' : '') . $childNode->nodeName);
             if ($childrenData == null) {
                 continue;
             }
             if (is_array($childrenData)) {
                 $nodeData = array_merge($nodeData, $childrenData);
             } else {
                 $nodeData = $childrenData;
             }
         }
         if (is_array($nodeData) && empty($nodeData)) {
             $nodeData = null;
         }
         $output[$node->nodeName] = $nodeData;
     } elseif ($node->nodeType == XML_CDATA_SECTION_NODE || $node->nodeType == XML_TEXT_NODE && trim($node->nodeValue) != '') {
         return $node->nodeValue;
     }
     return $output;
 }
Example #30
Show file File: Entry.php Project: shabbirvividads/magento2
0
 /**
  * Creates individual Entry objects of the appropriate type and
  * stores them as members of this entry based upon DOM data.
  *
  * @param \DOMNode $child The \DOMNode to process
  * @return void
  * @SuppressWarnings(PHPMD.CyclomaticComplexity)
  */
 protected function takeChildFromDOM($child)
 {
     $sc = $this->lookupNamespace('sc');
     $scp = $this->lookupNamespace('scp');
     $id = $child->namespaceURI . ':' . $child->localName;
     if ($child->localName == 'group') {
         $id .= ':' . $child->getAttribute('name');
     }
     switch ($id) {
         case "{$sc}:id":
         case "{$sc}:image_link":
         case "{$sc}:content_language":
         case "{$sc}:target_country":
         case "{$sc}:expiration_date":
         case "{$sc}:adult":
         case "{$sc}:attribute":
             $contentAttribute = new Attribute();
             $contentAttribute->transferFromDOM($child);
             $this->_contentAttributes[] = $contentAttribute;
             break;
         case "{$sc}:group:tax":
         case "{$scp}:tax":
             $tax = new \Magento\Framework\Gdata\Gshopping\Extension\Tax();
             $tax->transferFromDOM($child);
             $this->_tax[] = $tax;
             break;
         case $this->lookupNamespace('app') . ':' . 'control':
             $control = new \Magento\Framework\Gdata\Gshopping\Extension\Control();
             $control->transferFromDOM($child);
             $this->setControl($control);
             break;
         default:
             parent::takeChildFromDOM($child);
     }
 }