Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] dom serialization with qnames

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: Steve Loughran <steve.loughran AT gmail.com>
  • Cc: xom-interest <xom-interest AT lists.ibiblio.org>
  • Subject: Re: [XOM-interest] dom serialization with qnames
  • Date: Wed, 21 Dec 2005 09:01:52 -0500

Steve,

I'm not sure, but there's one common quirk of handling namespaces in DOM that you need to be aware of to make things work. You need to do two things on the DOM side to make DOM reliably work:

1. You only use namespace-aware methods like createElementNS, even when creating elements in no namespace. You never use the non-namespace aware methods.

2. You also add Attr objects for the xmlns and xmlns:prefix attributes to the DOM tree. These are not supplied automatically as they are in XOM. These must be consistent with the namespaces actually attached to each DOM element and attribute. However DOM does not enforce this.

If you've done this, then we can look in XOM for a problem. But it sounds like you might be making a classic pure-DOM mistake. It's insanity like this that first inspired JDOM and then XOM.

--
´╗┐Elliotte Rusty Harold elharo AT metalab.unc.edu
XML in a Nutshell 3rd Edition Just Published!
http://www.cafeconleche.org/books/xian3/
http://www.amazon.com/exec/obidos/ISBN=0596007647/cafeaulaitA/ref=nosim




Archive powered by MHonArc 2.6.24.

Top of Page