xml - javascript + e4x: how to test if an element is empty? -



xml - javascript + e4x: how to test if an element is empty? -

is there way test whether xml element empty using e4x?

e.g. if have element <foo />, want homecoming true, if have element has attributes, kid elements, or text, want homecoming false.

i slogged through ecma-357 v2 spec on e4x; methods xml nodes listed in section 13.4.4, , there no useful isxxx() or hasxxx() methods test; simplest way seems following:

function isemptynode(node){ homecoming node.children().length() == 0 && node.attributes().length() == 0; }

javascript xml e4x

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -