/** * * @param DOMNode $node * @return Ajde_Component */ public static function fromNode(Ajde_Template_Parser $parser, DOMNode $node) { $componentName = ucfirst(str_replace(self::AC_XMLNS . ':', '', $node->nodeName)); $className = 'Ajde_Component_' . $componentName; $nodeAttributes = $node->attributes; $innerXml = $parser->innerXml($node); $attributes = array(); foreach ($nodeAttributes as $attribute) { $attributes[$attribute->name] = $attribute->value; } return new $className($parser, $attributes, $innerXml); }