"John Utz" <[EMAIL PROTECTED]> writes:
> I think that i have created the correct actual_cast and reinterpret_class,
> but i just realized that this doesnt get propogated to the methods,
>
> i see there is some code that has some 'transmogrification' regexp work
> and does this work on the lsit @dom_node_methods.
>
> do i need to do something with this? do i need to create a
> @grammar_methods? what goes into this list and what doesnt go into this
> list, or am i barking up the wrong tree?
You're barking pretty loud. Chances are it's the wrong tree ;-)
At about line 609 in postModule.pl, there's the begining of a HERE
doc:
my $extra = <<'EXTRA';
which goes until almost the end of the file at line 1234. The last few
lines of the script print out $extra to the TEMP filehandle, and then
the temp file gets renamed to Xerces.pm.
The moral of this story is that anything that you insert between the
start of the HERE doc and the end will get printed out verbatim into
Xerces.pm.
The only thing you have to watch out for is the 'package'
declarations, like:
package XML::Xerces::DOM_Node;
every method defined after that line will be in the
XML::Xerces::DOM_Node package, until a new package declaration occurs.
So if you want stuff to appear in the XML::Xerces::Grammar package,
you'll need to stick it right before one of my package defs like so:
package XML::Xerces::Grammar;
# insert you methods here
package XML::Xerces::DOM_Node;
# define methods for DOM_Node...
Also, for actual_cast() you don't need the following:
sub actual_cast {
return undef unless _isa( ref($_[0]), 'XML::Xerces::DOM_Node' );
return $_[0] if $_[0]->isNull;
This should work:
sub actual_cast {
my ($self) = @_;
return undef unless $self->isa('XML::Xerces::Grammar');
The isNull() stuff is only for DOM_Node subclasses, and I have no idea
why the _isa() method exists. As far as I can tell, it is just a very
inefficient reimplementation of UNIVERSAL::isa(). If Harmon or
Frederick Paul are listening maybe they can enlighten me.
HTH,
jas.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]