7.7. Opt_Compiler_Processor class
7.7.9. postprocessAttribute()
7.7.8. getName()
« Previous
7.7.10. postprocessNode()
Next »

7.7.9. postprocessAttribute()

ConstructOptional method for implementation by the programmer
Visibilitypublic
Referencevoid postprocessAttribute(Opt_Xml_Node $node, Opt_Xml_Attribute $attribute)
Argument list
$node - Opt_Xml_Node
The node with the attribute to process.
$attribute - Opt_Xml_Attribute
The attribute to process.

Works much like Opt_Compiler_Processor::postprocessNode(), but it allows to postprocess the instruction XML attribute. In order to be executed by the compiler, the Opt_Compiler_Processor::processAttribute() must set the attribute variable postprocess to true:

public function processAttribute(Opt_Xml_Node $node, Opt_Xml_Attribute $attr)
{
    // The attribute must be postprocessed after the node children are parsed.
    $attr->set('postprocess', true);
} // end processAttribute();
 
public function postprocessAttribute(Opt_Xml_Node $node, Opt_Xml_Attribute $attr)
{
    echo 'Hello world!';
} // end postprocessAttribute();

See also:

7.7.9. postprocessAttribute()
7.7. Opt_Compiler_Processor class
« Previous
7.7.8. getName()
Next »
7.7.10. postprocessNode()