I'm decoding some XML and want to detect whether a particular element (whose
text should be a number) is present and use a default number if it isn't. It
seems that if
node.min
is not present the expression still returns an XMLList, so I'm doing
something like this:
private static function decodeNumber(value:XMLList):Number {
if (value.length() < 1) {
return NaN;
} else {
return new Number(value);
}
Are there some E4X tricks I'm missing?
More generally, any good XML decoders that work with a class map so I can
get typed AS objects?