摘要 |
According to a technique described herein, a binding document comprises one or more “<bind>” element instances. Each “<bind>” element instance indicates an association between (a) an SVG element instance and (b) a class. When a binding's name is passed to a “createFromTemplate( )” method, the method processes all of the “<bind>” element instances that are associated within that name. For each such “<bind>” element instance, the method (a) creates, in an SVG DOM tree, a clone of a node that corresponds to an SVG element instance indicated in that “<bind>” element instance, (b) instantiates an object that is an instance of a class that is indicated in that “<bind>” element instance, and (c) stores data that establishes a binding between the clone node and the object. Methods of the object can be invoked to affect and/or alter attributes of the clone node to which the object is bound.
|