Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Re: Re: Handler communication in XML::Twig

by diotalevi (Canon)
on Feb 12, 2004 at 18:25 UTC ( [id://328628]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Handler communication in XML::Twig
in thread Handler communication in XML::Twig

This is just an FYI but I didn't get the sense from the documentation that this was something to be used as a shared scratchpad. On re-reading it just now it occurs to me that I don't know what the private attribute is supposed to be written to or what its lifetime is.

Replies are listed 'Best First'.
Re: Re: Re: Re: Handler communication in XML::Twig
by mirod (Canon) on Feb 12, 2004 at 21:02 UTC

    The "private" attributes are just like regular attributes, they can be accessed just like regular ones, they are just not output. So they live with the element they are attached to, and disappear when it does, either when the whole twig element goes out of scope or when the element is deleted/purged or flushed.

    I usually use private attributes to store information that is attached to a part of the tree, what you call a scratchpad I guess. But I have also used it to store data for the whole document, as an "official" way to store attributes in the OO sense. This way I know that even if the author changed the underlying implementation of the twig this method would still be valid ;--)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://328628]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2024-03-29 10:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found