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

Elliotte Harold elharo at metalab.unc.edu
Sat Mar 29 10:21:50 EDT 2008


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/


More information about the XOM-interest mailing list