ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl-xml
perl-xml
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

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved