Albert, I really appreciate your activity! :)
DOM interface names are normative and must say, I'm not a friend of
aliases/overloads you propose.
This my opinion (more cultural thing then something else) are
'shortcuts' like selectSingleNode, selectNodes and documentElement.
I'll collect ideas like this for a while and make conclusions before the
next release.
Stay in touch :)
Pavel
Albert N. MICHEEV wrote:
> Hallo Pavel,
> __________________________________________________________________________
> Monday, July 09, 2001, 1:22:11 PM, you wrote:
>
>
> PH> it ought to be fiwxed somewhere else (in the C API)
>
> Yes, I have understood it.
> What you look to add the following for simplification of syntax (?):
>
>
> package XML::Sablotron::DOM::Node;
>
> *nodeType = \&getNodeType;
> *parentNode = \&getParentNode;
> *firstChild = \&getFirstChild;
> *lastChild = \&getLastChild;
> *nextSibling = \&getNextSibling;
> *previousSibling = \&getPreviousSibling;
> *ownerDocument = \&getOwnerDocument;
> sub nodeValue(;$){ $#_ ? setNodeValue(shift, shift) : getNodeValue(shift) }
> sub nodeName(;$){ $#_ ? setNodeName(shift, shift) : getNodeName(shift) }
>
> sub selectSingleNode($){
> my $self = shift; my $res = $self->xql( shift );
> return $res ? $res->[0] : undef;
> }
>
> sub selectNodes($){
> my $self = shift; my $res = $self->xql( shift );
> return wantarray ? @$res : $res;
> }
>
>
> package XML::Sablotron::DOM::Element;
> *tagName = \&getNodeName;
>
>
> package XML::Sablotron::DOM::Document;
>
> sub documentElement(;$)
> {
> my ($self, $replace) = @_;
>
> my $elem = $self->firstChild();
> while( $elem ){
> last if $elem->nodeType == XML::Sablotron::DOM::ELEMENT_NODE;
> $elem = $elem->nextSibling();
> }
>
> if( $replace ){
> die unless $replace->nodeType == XML::Sablotron::DOM::ELEMENT_NODE;
> $self->replaceChild( $replace, $elem );
> $elem = $replace;
> }
>
> return $elem;
> }
>
>
> __________________________________________________________________________
> Alles Gutes,
> Albert mailto:[EMAIL PROTECTED]
>
>
--
Pavel Hlavnicka
Ginger Alliance
www.gingerall.com