Subclassing XML::LibXML::Document
by Calbazana, Al other posts by this author
Sep 5 2002 1:24AM messages near this date
view in the new Beta List Site
XML::Simple Help
|
Re: Subclassing XML::LibXML::Document
Hello,
I'd like to subclass XML::LibXML::Document in order to assist with creation
of XML documents (I want to ease XML creation and have all the facilities
of a DOM). Additionally, I'd like my subclass of XML::LibXML::Document to
be an "event notifiier". So when nodes are added or modified, e.g. - the
subclass' state has changed, I'd like it to be able to fire off events to
listeners.
I can subclass Document just fine... The problem I am having is that I can
not work with XML::LibXML::Document since it seems to be a scalar ref and
not a hash ref. When I try to add additional properties to it, it fails
with (Not a HASH reference...). Is there any way around this? I'd like to
subclass rather than wrap a Document.
My constructor goes something like:
Our @ISA = qw{XML::LibXML::Document);
Sub new{
My $class = shift;
My $self = $class-> SUPER::new('1.0','UTF8');
Bless $self, $class;
$self-> {'Listeners'} = []; # fails!
Return $self,
}
Thanks!
Al
**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.
www.mimesweeper.com
**********************************************************************
Attachments:
unknown1
Thread:
Calbazana, Al
D. Hageman
|