<oXygen/> general issues.
Posts: 2
Joined: Fri Feb 26, 2010 1:42 am


Post by cleciovarjao » Tue Apr 13, 2010 7:01 pm


Is "isEmpty()" method supposed to tell if the element content is empty?

for instance, would <p type="abc"/> return true? as now (11.2) I'm getting false. Is it because of the attributes?
I'm not sure but I believe it was returning true on previous versions.


Posts: 7032
Joined: Fri Jul 09, 2004 5:18 pm

Re: AuthorDocumentFragment.isEmpty()

Post by Radu » Wed Apr 14, 2010 9:44 am

Hi Clecio,

The isEmpty implementation returns true if nothing is contained in the fragment (no text, no nodes). It has always worked this way.
If you want to check that an empty element is inside, you can look at the getContentNodes() for example, check that it contains a single node and at the getLength() to see that it is 2-corresponding to the two content markers added by the single node.

Radu Coravu
<oXygen/> XML Editor

Post Reply