Resolve value by uses as attribute as raw.

@param  \SimpleXMLElement  $content
@param  string|null  $use
@param  mixed  $default

@return mixed
329899
protected function getRawValueAttribute(SimpleXMLElement $content, ?string $use, $default = null)
    {
        list($value, $attribute) = \explode('::', $use, 2);

        if (! empty($value)) {
            if (\is_null($parent = object_get($content, $value))) {
                return $default;
            }
        } else {
            $parent = $content;
        }

        $attributes = $parent->attributes();

        return data_get($attributes, $attribute, $default);
    }
117502
public function getContext( $key = null, $default = null ) {
		if ( $key === null ) {
			return $this->context;
		}

		return Arr::get( $this->context, $key, $default );
	}
502534
public final static function get(string $source, $key, $default = null){
		return Arr::get(self::decode($source), $key, $default);
	}
987288
public function raw($key, $default = null)
    {
        if (strpos($key, '[') === false) {
            return Accessor::get($this->data, $key, $default);
        }
        $found = $this->parseRaw($key);
        if (!is_null($found)) {
            return $found;
        }
        return $default;
    }
447551
protected function _defaultData($content)
    {
        $content = @unserialize($content);
        if (empty($content) || !is_a($content, \stdClass::class)) {
            $content = new \stdClass;
        }
        $content->file = empty($content->file) ? '' : $content->file;
        $content->title = empty($content->title) ? '' : $content->title;
        return $content;
    }
255180
public function serialize($use = 'encoded')
    {
        return $this->serialize_val($this->value, $this->name, $this->type, $this->element_ns, $this->type_ns, $this->attributes, $use, true);
    }
1324294
protected function getVars($content, $details = [])
    {
        // Build defaults
        $defaults = [
            'id' => '',
            'title' => Translate::t('textarea.title', [], 'textareafield'),
            'default' => '',
            'description' => '',
            'placeholder' => '',
            'rows' => 8,
        ];

        // Build defaults data
        $vars = array_merge($defaults, $content);

        // Retrieve field value
        $vars['val'] = $this->getValue($content['id'], $details, $vars['default']);

        // Update vars
        $this->getModel()->setVars($vars);
    }
456895
public function getAttribute($name, $default = null)
    {
        $value = $this->reader->getAttribute($name);

        return null !== $value ? $value : $default;
    }
347208
def get(self, default=None, callback=None):
        """
        value = self._xml.text if self._xml.text else default
        return callback(value) if callback else value
676700
private static function _arr2xml($data, $content = '')
    {
        foreach ($data as $key => $val) {
            is_numeric($key) && $key = 'item';
            $content .= "<{$key}>";
            if (is_array($val) || is_object($val)) {
                $content .= self::_arr2xml($val);
            } elseif (is_string($val)) {
                $content .= '<![CDATA[' . preg_replace("/[\\x00-\\x08\\x0b-\\x0c\\x0e-\\x1f]/", '', $val) . ']]>';
            } else {
                $content .= $val;
            }
            $content .= "</{$key}>";
        }
        return $content;
    }
774657
public function parse($content)
    {
        if (strpos($content, '@ORM') === false) {
            return null;
        }

        if (preg_match(self::PATTERN, $content, $matches)) {
            return (new \SplFixedArray(2))->fromArray([$matches[1], $matches[2]]);
        }

        return null;
    }
1303134
public function getRequestValue($name, $default = null)
    {
        $request = $this->getModule()->getRequest();

        return isset($request->request[$name]) ? $request->request[$name] : $request->query($name, $default);
    }
865688
public function to_xml($data = null, $structure = null, $basenode = null, $use_cdata = null)
	{
		if ($data == null)
		{
			$data = $this->_data;
		}

		is_null($basenode) and $basenode = \Config::get('format.xml.basenode', 'xml');
		is_null($use_cdata) and $use_cdata = \Config::get('format.xml.use_cdata', false);

		// turn off compatibility mode as simple xml throws a wobbly if you don't.
		if (ini_get('zend.ze1_compatibility_mode') == 1)
		{
			ini_set('zend.ze1_compatibility_mode', 0);
		}

		if ($structure == null)
		{
			$structure = simplexml_load_string("<?xml version='1.0' encoding='utf-8'?><$basenode />");
		}

		// Force it to be something useful
		if ( ! is_array($data) and ! is_object($data))
		{
			$data = (array) $data;
		}

		foreach ($data as $key => $value)
		{
			// replace anything not alpha numeric
			$key = preg_replace('/[^a-z_\-0-9]/i', '', $key);

			// no numeric keys in our xml please!
			if (is_numeric($key))
			{
				// make string key...
				$key = (\Inflector::singularize($basenode) != $basenode) ? \Inflector::singularize($basenode) : 'item';
			}

			// if there is another array found recrusively call this function
			if (is_array($value) or is_object($value))
			{
				$node = $structure->addChild($key);

				// recursive call if value is not empty
				if( ! empty($value))
				{
					$this->to_xml($value, $node, $key, $use_cdata);
				}
			}

			else
			{
				// add single node.
				$encoded = htmlspecialchars(html_entity_decode($value, ENT_QUOTES, 'UTF-8'), ENT_QUOTES, "UTF-8");

				if ($use_cdata and ($encoded !== (string) $value))
				{
					$dom = dom_import_simplexml($structure->addChild($key));
					$owner = $dom->ownerDocument;
					$dom->appendChild($owner->createCDATASection($value));
				}
				else
				{
					$structure->addChild($key, $encoded);
				}
			}
		}

		// pass back as string. or simple xml object if you want!
		return $structure->asXML();
	}
1316009
public function parse($content)
    {
        $content = $this->normalize($content);

        list($method, $path, $scheme) = $this->getStatus($content);

        // resolve uri path
        if ($this->baseUrl !== null) {
            $path = UriResolver::resolve($this->baseUrl, new Uri($path));
        } else {
            $path = new Uri($path);
        }

        $request = new Request($path, $method);
        $request->setProtocolVersion($scheme);

        list($header, $body) = $this->splitMessage($content);

        $this->headerToArray($request, $header);

        $request->setBody(new StringStream($body));

        return $request;
    }
89862
public static function xml($index = null, $default = null)
	{
		static::$xml === null and static::hydrate_raw_input('xml');
		return (func_num_args() === 0) ? static::$xml : \Arr::get(static::$xml, $index, $default);
	}
905513
public static function nullMinifier($content)
    {
        if (isset($content[0]) && $content[0] === "\xef") {
            $content = substr($content, 3);
        }
        $content = str_replace("\r\n", "\n", $content);

        return trim($content);
    }
45814
public function resolveUrlAliasSchema(Content $content, ContentType $contentType = null)
    {
        if ($contentType === null) {
            $contentType = $this->contentTypeHandler->load($content->contentInfo->contentTypeId);
        }

        return $this->resolve(
            strlen($contentType->urlAliasSchema) === 0 ? $contentType->nameSchema : $contentType->urlAliasSchema,
            $contentType,
            $content->fields,
            $content->versionInfo->languageCodes
        );
    }