Set XML property or method argument value.

@param string      $value
@param \DOMElement $node
@param ClassMetadata[]       $classesMetadata
801
protected function setAttribute(string $value, \DOMElement $node, array $classesMetadata)
    {
        if (array_key_exists($value, $classesMetadata)) {
            $node->setAttribute('service', $value);
        } elseif (class_exists($value)) {
            $node->setAttribute('class', $value);
        } else {
            $node->setAttribute('value', $value);
        }
    }
656390
public function setValue(string $value = null) : Element
    {
        if (!is_null($value)) {
            $tmp = preg_replace('/[^\d]/', '', $value);
            if (strlen($tmp)) {
                $value = $tmp;
                if ($value{0} != '0') {
                    $value = "0$value";
                }
            }
        }
        return parent::setValue($value);
    }
759626
public function setAttribute($name, $value)
    {
        if (is_numeric($value)) {
            $value = (string) $value;
        }

        if (!is_string($value) && $value !== null) {
            throw new InvalidArgumentException(sprintf('%s expects parameter 2 to be string or null, %s given', __METHOD__, (is_object($value) ? get_class($value) : gettype($value))));
        }

        $this->node->setAttribute($name, $value);

        return $this;
    }
286482
private static function convertNode(XMLElement $element, DOMNode $node)
    {
        if ($node->hasAttributes()) {
            foreach ($node->attributes as $name => $attrEl) {
                $element->setAttribute($name, General::sanitize($attrEl->value));
            }
        }

        if ($node->hasChildNodes()) {
            foreach ($node->childNodes as $childNode) {
                if ($childNode instanceof DOMCdataSection) {
                    $element->setValue(General::wrapInCDATA($childNode->data));
                } elseif ($childNode instanceof DOMText) {
                    if ($childNode->isWhitespaceInElementContent() === false) {
                        $element->setValue(General::sanitize($childNode->data));
                    }
                } elseif ($childNode instanceof DOMElement) {
                    self::convert($element, $childNode);
                }
            }
        }
    }
1045076
public function setValue($value)
    {
        if ($this->value !== null && $value !== null) {
            //throw new Exception\BadMethodCallException("Can't set value for static form element");
        }

        return parent::setValue($value);
    }
1271804
private function mapBorderProperty(\DOMElement $node, $value)
    {
        if (!$this->isTableOrImageNode($node)) {
            return;
        }

        if ($value === 'none' || $value === '0') {
            $node->setAttribute('border', '0');
        }
    }
1050838
static protected function _set_table_cellpadding(\DOMElement $node, $value)
    {
        $cell_list = self::get_cell_list($node);

        foreach ($cell_list as $cell) {
            self::append_style($cell, "; padding: {$value}px;");
        }

        return null;
    }
658440
protected function addSequentialNode(DOMElement $element, $value)
    {
        if (empty($element->nodeValue)) {
            $element->nodeValue = htmlspecialchars($value);

            return;
        }

        $child = $element->cloneNode();
        $child->nodeValue = htmlspecialchars($value);
        $element->parentNode->appendChild($child);
    }
1350832
private function addNewXmlElement(DOMDocument $dom, DOMElement $node, $name, $value)
    {
        $new = $dom->createElement($name);
        $new->appendChild($dom->createTextNode($value));
        $node->appendChild($new);
    }
1168470
public function setMethod($value)
    {
        $allowedMethods = self::allowedMethods();

        if (!in_array($value, $allowedMethods, true)) {
            throw new DomainException(sprintf(self::MSG_UNEXPECTED_METHOD, implode(', ', $allowedMethods)));
        }

        return $this->setAttribute('method', $value);
    }
1121169
private function mapMarginProperty(\DOMElement $node, $value)
    {
        if (!$this->isTableOrImageNode($node)) {
            return;
        }

        $margins = $this->parseCssShorthandValue($value);
        if ($margins['left'] === 'auto' && $margins['right'] === 'auto') {
            $node->setAttribute('align', 'center');
        }
    }
595019
private function mapAttributes(\DOMNode $node, $key, $value)
    {
        if (null !== $attrName = $this->getAttributeName($key)) {
            foreach ((array)$value as $attrKey => $attrValue) {
                $node->setAttribute($attrKey, $this->getAttributeValue($attrValue, $attrKey));
            }


            return true;
        }

        if (is_scalar($value) && $this->isMappedAttribute($node->nodeName, $key) && $this->isValidNodeName($key)) {
            $node->setAttribute($key, $this->getAttributeValue($value, $key));

            return true;
        }

        return false;
    }
805819
private function convertElement(DOMElement $element, $value)
    {
        $sequential = $this->isArrayAllKeySequential($value);

        if (! is_array($value)) {
            $value = htmlspecialchars($value);

            $value = $this->removeControlCharacters($value);

            $element->nodeValue = $value;

            return;
        }

        foreach ($value as $key => $data) {
            if (! $sequential) {
                if (($key === '_attributes') || ($key === '@attributes')) {
                    $this->addAttributes($element, $data);
                } elseif ((($key === '_value') || ($key === '@value')) && is_string($data)) {
                    $element->nodeValue = htmlspecialchars($data);
                } elseif ((($key === '_cdata') || ($key === '@cdata')) && is_string($data)) {
                    $element->appendChild($this->document->createCDATASection($data));
                } elseif ((($key === '_mixed') || ($key === '@mixed')) && is_string($data)) {
                    $fragment = $this->document->createDocumentFragment();
                    $fragment->appendXML($data);
                    $element->appendChild($fragment);
                } else {
                    $this->addNode($element, $key, $data);
                }
            } elseif (is_array($data)) {
                $this->addCollectionNode($element, $data);
            } else {
                $this->addSequentialNode($element, $data);
            }
        }
    }
784672
public function setXmlBasicMetadata(\AgentSIB\Diadoc\Api\Proto\Events\EncryptedXmlBasicDocumentMetadata $value)
    {
        $this->XmlBasicMetadata = $value;
    }
832601
public function addMeta($tag, $value, array $attributes = []){
		$value = $this->h($value);
		if( false !== strpos($tag, ':') ){
			$tags = explode(':', $tag);
			$node = $this->dom->metadata->addChild($tags[1], $value, Schemas::getUri($tags[0]));
		}else{
			$node = $this->dom->metadata->addChild($tag, $value);
		}
		foreach( $attributes as $key => $val ){
			$node[$key] = $this->h($val);
		}
	}
1258814
static protected function _set_font_size(\DOMElement $node, $value)
    {
        $style = $node->getAttribute(self::$_style_attr);

        if ($value[0] === "-" || $value[0] === "+") {
            $value = self::$_last_basefont_size + (int)$value;
        }

        if (isset(self::$_font_size_lookup[$value])) {
            $style .= "; font-size: " . self::$_font_size_lookup[$value] . ";";
        } else {
            $style .= "; font-size: $value;";
        }

        return ltrim($style, "; ");
    }
1022204
protected function setNonEmptyAttribute(\DomElement $element, string $name, string $value = null) : void
    {
        if (! is_null($value)) {
            $element->setAttribute($name, $value);
        }
    }