xom-interest AT lists.ibiblio.org
Subject: XOM API for Processing XML with Java
List archive
- From: Elliotte Rusty Harold <elharo AT metalab.unc.edu>
- To: "Kevin S. Clarke" <ksclarke AT stanford.edu>, xom-interest AT lists.ibiblio.org
- 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:
Hi,
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 metalab.unc.edu
Processing XML with Java (Addison-Wesley, 2002)
http://www.cafeconleche.org/books/xmljava
http://www.amazon.com/exec/obidos/ISBN%3D0201771861/cafeaulaitA
-
[XOM-interest] namespace question,
Kevin S. Clarke, 05/08/2003
- Re: [XOM-interest] namespace question, Elliotte Rusty Harold, 05/08/2003
Archive powered by MHonArc 2.6.24.