Page 1 of 1

AuthorDocumentFragment.isEmpty()

Posted: Tue Apr 13, 2010 7:01 pm
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

Re: AuthorDocumentFragment.isEmpty()

Posted: Wed Apr 14, 2010 9:44 am
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