AuthorDocumentFragment.isEmpty()

Oxygen general issues.
cleciovarjao
Posts: 2
Joined: Fri Feb 26, 2010 1:42 am

AuthorDocumentFragment.isEmpty()

Post by cleciovarjao »

Hi,

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.

Thanks
Radu
Posts: 9051
Joined: Fri Jul 09, 2004 5:18 pm

Re: AuthorDocumentFragment.isEmpty()

Post by Radu »

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.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply