[jdom-interest] XMLOutputter NPE
wbiggs at elite.com
Thu Aug 3 15:46:38 PDT 2000
The XML specification states that there should be no semantic difference
So if you rely on that to indicate a null (and it's tempting, I've been down
that path) you're probably going to get thrown to the wolves on the whim of
whatever parser/outputter you choose.
What you're probably looking for is
<tag xsl:null="true" />
Which JDOM doesn't directly support (you have to define the XSL namespace,
etc.), but it at least gives you a clear and reliable semantic distinction
between null and empty.
From: Will Glozer [mailto:will.glozer at jda.com]
Sent: Thursday, August 03, 2000 3:20 PM
To: 'jdom-interest at jdom.org'
Subject: [jdom-interest] XMLOutputter NPE
I'm just starting to use JDOM, so please forgive me in advance if this is
a known issue... I looked through the more recent logs and didn't see
XMLOutputter xmlOut = new XMLOutputter();
Element e = new Element("test");
Document doc = new Document(e);
That code will throw a NullPointerException inside XMLOutputter.output
the contents of the Element is an empty string... The question I have is
or not JDOM will ever be able to distinguish between empty,
Element content and null, String == null, content.
I was able to do this with W3C DOM, so I'd like to see it in JDOM. Perhaps
consider doing "<tag />" as null content and "<tag></tag>" as empty content?
To control your jdom-interest membership:
More information about the jdom-interest