Hi.  The XML tools that you guys at Apache have been building are fantastic
and I want to let you know how helpful it's been to my work.

I am emailing because I am having difficulty creating a tree walker for a
parsed documents and I think it's due to a deficiency in the perl API to
Xerces-C.  The problem centers around the fact that there is no way to
create a new XML::Xerces::DOM_NodeFilter object (I've included the relevent
portion of the Xerces.pm module at the bottom of this email).  The new()
method is entirely absent.

Consequently, there seems no way to create a treewalker object because
DOM_Document_createTreeWalker( ) requires a DOM_NodeFiler object as its 3
argument.  Is there any way to get around this?

Thanks for any and all help,

Sincerely,
ted sandler


############# Class : XML::Xerces::DOM_NodeFilter ##############

package XML::Xerces::DOM_NodeFilter;
@ISA = qw( XML::Xerces );
%OWNER = ();
%ITERATORS = ();
*FILTER_ACCEPT = *XML::Xercesc::DOM_NodeFilter_FILTER_ACCEPT;
*FILTER_REJECT = *XML::Xercesc::DOM_NodeFilter_FILTER_REJECT;
*FILTER_SKIP = *XML::Xercesc::DOM_NodeFilter_FILTER_SKIP;
*SHOW_ALL = *XML::Xercesc::DOM_NodeFilter_SHOW_ALL;
*SHOW_ELEMENT = *XML::Xercesc::DOM_NodeFilter_SHOW_ELEMENT;
*SHOW_ATTRIBUTE = *XML::Xercesc::DOM_NodeFilter_SHOW_ATTRIBUTE;
*SHOW_TEXT = *XML::Xercesc::DOM_NodeFilter_SHOW_TEXT;
*SHOW_CDATA_SECTION = *XML::Xercesc::DOM_NodeFilter_SHOW_CDATA_SECTION;
*SHOW_ENTITY_REFERENCE =
*XML::Xercesc::DOM_NodeFilter_SHOW_ENTITY_REFERENCE;
*SHOW_ENTITY = *XML::Xercesc::DOM_NodeFilter_SHOW_ENTITY;
*SHOW_PROCESSING_INSTRUCTION =
*XML::Xercesc::DOM_NodeFilter_SHOW_PROCESSING_INSTRUCTION;
*SHOW_COMMENT = *XML::Xercesc::DOM_NodeFilter_SHOW_COMMENT;
*SHOW_DOCUMENT = *XML::Xercesc::DOM_NodeFilter_SHOW_DOCUMENT;
*SHOW_DOCUMENT_TYPE = *XML::Xercesc::DOM_NodeFilter_SHOW_DOCUMENT_TYPE;
*SHOW_DOCUMENT_FRAGMENT =
*XML::Xercesc::DOM_NodeFilter_SHOW_DOCUMENT_FRAGMENT;
*SHOW_NOTATION = *XML::Xercesc::DOM_NodeFilter_SHOW_NOTATION;

*acceptNode = *XML::Xercesc::DOM_NodeFilter_acceptNode;
sub DISOWN {
    my $self = shift;
    my $ptr = tied(%$self);
    delete $OWNER{$ptr};
    };

sub ACQUIRE {
    my $self = shift;
    my $ptr = tied(%$self);
    $OWNER{$ptr} = 1;
    };

    my $parser = XML::Xerces::DOMParser->new();
    $parser->setValidationScheme ($validate);
    $parser->setDoNamespaces ($namespace);
    $parser->setCreateEntityReferenceNodes(1);
    $parser->setDoSchema ($schema);

    my $error_handler = XML::Xerces::PerlErrorHandler->new();
    $parser->setErrorHandler($error_handler);

    eval { $parser->parse(XML::Xerces::LocalFileInputSource->new($file)); };

    die($@) if $@;

    my $doc = $parser->getDocument();
    my $tw = $doc->createTreeWalker();  # <-- This doesn't work!




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to