classpathx-xml
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Classpathx-xml] AElfred DOM local names are incorrect for text, co


From: Elliotte Rusty Harold
Subject: Re: [Classpathx-xml] AElfred DOM local names are incorrect for text, comment, and document nodes
Date: Thu, 13 Dec 2001 14:23:13 -0400

At 11:05 AM -0800 12/13/01, David Brownell wrote:
Seems like a bug in your test case ...


 I've noticed that AElfred's DOM implementation

AElfred has no DOM implementation ... it's only a SAX parser! :)

Presumably you're talking about the "gnu.xml.dom.*" code,
which is bundled into GNUJAXP along with AElfred2.


Yes, that's correct.

     reports #text as the
 *local* name for text nodes, #comment as the local name for comment
 nodes, and #document as the local name for document nodes.

Hmm, I don't see this.  DomNode.java returns null for the local name,
everything else subclasses that. Only DomElement and DomAttribute
override that method, through the common DomNsNode base class.
And that code has been that way for several years now.

That is, the code sure says it can't have the bug you describe.  And a
simple test program I wrote says that's as expected.  More featureful
test suites haven't reported such a bug either.


I haven't looked at the source code, but I do have a test program that shows the behavior I describe. Possibly there are bugs in my own code, though so far I can't see them. I haven't boiled my test program down to one class yet, but if you take a look at

http://www.ibiblio.org/xml/books/xmljava/chapters/ch09s05.html

you'll find the three classes required to demonstrate the bug. Just run Example 9-10 (which is dependent on examples 9-8 and 9-9) across Example 9-1 (which you'll find a few pages earlier at http://www.ibiblio.org/xml/books/xmljava/chapters/ch09s02.html ) Anyway, that's what I'm doing to see the bug.

I just added some debugging output to make sure I was using gnu.xml.dom.* and indeed I was. (It's all loaded through JAXP).

It could easily be a bug in my code, but if so I can't find it; and as I said the program does work as expected when I switch to Xerces by -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl

I may not be using the absolutely latest code. I should upgrade and check that.

Is it perhaps possible that because my program always asks for the name of a node before asking for the local name, that the name is getting cached? That's about all I can think of. I'll look into this more and let you know what I find.
--

+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | address@hidden | Writer/Programmer |
+-----------------------+------------------------+-------------------+
|          The XML Bible, 2nd Edition (Hungry Minds, 2001)           |
|              http://www.ibiblio.org/xml/books/bible2/              |
|   http://www.amazon.com/exec/obidos/ISBN=0764547607/cafeaulaitA/   |
+----------------------------------+---------------------------------+
|  Read Cafe au Lait for Java News:  http://www.cafeaulait.org/      |
|  Read Cafe con Leche for XML News: http://www.ibiblio.org/xml/     |
+----------------------------------+---------------------------------+



reply via email to

[Prev in Thread] Current Thread [Next in Thread]