Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] namespace question

xom-interest AT

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Elliotte Rusty Harold <elharo AT>
  • To: "Kevin S. Clarke" <ksclarke AT>, xom-interest AT
  • Cc:
  • Subject: Re: [XOM-interest] namespace question
  • Date: Thu, 8 May 2003 20:51:49 -0400

At 5:26 PM -0700 5/8/03, Kevin S. Clarke wrote:

I am getting a blank namespace when I serialize a document. I want a
default namespace that is not repeated on each element so I set it on
root. I also add another namespace declaration with prefix that I can
use on deep children (with the URI also declared on the root element).

The output is correct. You have not put e1 through e4 in any namespace. Consequently the serializer inserts the necessary xmlns="" declarations. Given what the code builds I don't see any more natural way to serialize the document.

Element e1 = new Element("e1");
Element e2 = new Element("e2");
Element e3 = new Element("e3");
Element e4 = new Element("fake:e4", fakeNS);


Elliotte Rusty Harold
elharo AT
Processing XML with Java (Addison-Wesley, 2002)

Archive powered by MHonArc 2.6.24.

Top of Page