You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by "Jason E. Stewart" <ja...@openinformatics.com> on 2002/06/13 02:39:50 UTC

MemBufInputSource/XercesDOMParser wierdness

Hey Tinny and others,

I grabbed the latest from CVS to test out the new DOM and the DOM
Level 3 stuff to make it work with Xerces-P.

I've got a very odd problem: whenever I use a MemBufInputSource and
the XercesDOMParser, I get a bogus comment node as the first node of
the document. This does not happen when using the C++ API directly,
only when accessing via Perl - but after debugging it for some time
I've temporarily run out of ideas.

If I use SAXParser things are fine, or if I use LocalFileInputSource
with the XercesDOMParser things also work

Do you have any ideas what might be happening?

Cheers,
jas.

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


Re: MemBufInputSource/XercesDOMParser wierdness

Posted by "Jason E. Stewart" <ja...@openinformatics.com>.
"Tinny Ng" <tn...@ca.ibm.com> writes:

> I didn't encounter this before.   And the problem only arise if using
> Xerces-Perl, but not with Xerces-C++ directly, right?

Yes, correct.

Here's some more info. During the parse the Document is configured
correctly, but when I leave parse() and invoke getDocument() the
Document has changed.

getFirstChild() returns the bogus comment node because the node list
is somehow messed up, I need to dig further for this.

However, getDocumentElement() returns the root node just fine.

My real trouble is that I stepping through the code in GDB, and I
don't have a lot of experience debugging Xerces-C, so printing out
XMLCh* arrays was a bit of a pain, but I wrote some debug routines
that are helping.

Any tipes you can give for debugging will be appreciated.

Cheers,
jas.

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


Re: MemBufInputSource/XercesDOMParser wierdness

Posted by Tinny Ng <tn...@ca.ibm.com>.
Jason,

I didn't encounter this before.   And the problem only arise if using
Xerces-Perl, but not with Xerces-C++ directly, right?   Since I don't know
how Xerces-Perl works, not quite sure what's wrong.   If you said it is a
bogus "text" node, then I may guess it is the "newline" .... But now you
said you've got a bogus "comment" code, then it sounds quite weird to me.

Just FYI, we didn't touch MemBufInputSource since Xerces-C++ 1.7.  And for
XercesDOMParser, it's similar to IDOMParser before, the major difference is
we have introduced the parent class "AbstractDOMParser" which has most of
the parser code.   Then XercesDOMParser and DOMBuilderImpl are derived from
it.

Please feel free to let me know further information about your problem, see
if we can offer any help.

Tinny

----- Original Message -----
From: "Jason E. Stewart" <ja...@openinformatics.com>
To: <xe...@xml.apache.org>
Sent: Wednesday, June 12, 2002 8:39 PM
Subject: MemBufInputSource/XercesDOMParser wierdness


> Hey Tinny and others,
>
> I grabbed the latest from CVS to test out the new DOM and the DOM
> Level 3 stuff to make it work with Xerces-P.
>
> I've got a very odd problem: whenever I use a MemBufInputSource and
> the XercesDOMParser, I get a bogus comment node as the first node of
> the document. This does not happen when using the C++ API directly,
> only when accessing via Perl - but after debugging it for some time
> I've temporarily run out of ideas.
>
> If I use SAXParser things are fine, or if I use LocalFileInputSource
> with the XercesDOMParser things also work
>
> Do you have any ideas what might be happening?
>
> Cheers,
> jas.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org