Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] Bug (?) in Saxon/DOM/XOM interaction: Attributes instead of namespaces; strange element tree structure

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Elliotte Harold <elharo AT metalab.unc.edu>
  • To: Christoph LANGE <ch.lange AT jacobs-university.de>
  • Cc: XOM <xom-interest AT lists.ibiblio.org>, Saxon <saxon-help AT lists.sourceforge.net>
  • Subject: Re: [XOM-interest] Bug (?) in Saxon/DOM/XOM interaction: Attributes instead of namespaces; strange element tree structure
  • Date: Sat, 29 Mar 2008 07:21:50 -0700

Christoph LANGE wrote:
On Friday 22 February 2008 04:12:40 Elliotte Harold wrote:
Christoph LANGE wrote:
Dear XOM developers, dear Saxon developers,

sorry for crossposting, but this bug is actually related to both XOM
and Saxon. As far as I can judge on that, Saxon generates DOM output that
is not completely valid and makes XOM's DOMConverter crash.
I'll need to think about this one. However a elf-contained test case
would be very helpful in figuring out exactly what's going on and whose
problem it is.

Please see the attached files. In order to run them, make sure that XOM and Saxon and the current directory are in the classpath, e.g.


Thanks for the test case. The problem is a common bug in DOM code. Specifically you never made the DOM factory namespace aware. After

DocumentBuilderFactory df = DocumentBuilderFactory.newInstance();

You have to add

df.setNamespaceAware(true);

That this isn't the default--that non-namespacewareness is even allowed--is just one more example of DOM brain damage.

--
Elliotte Rusty Harold elharo AT metalab.unc.edu
Java I/O 2nd Edition Just Published!
http://www.cafeaulait.org/books/javaio2/
http://www.amazon.com/exec/obidos/ISBN=0596527500/ref=nosim/cafeaulaitA/



  • Re: [XOM-interest] Bug (?) in Saxon/DOM/XOM interaction: Attributes instead of namespaces; strange element tree structure, Elliotte Harold, 03/29/2008

Archive powered by MHonArc 2.6.24.

Top of Page