James,

> Though you could use
>
> Number n = element.numberValueOf( "@foo" );
>
> Or to specify a default if the attribute is not specified you could do...
>
> Number n = element.numberValueOf( "@foo | 0.5" );
>
> So you get an easy way to extract numerical attributes and you can specify
a
> default as well!

There is also the aspect of performance: is there a significant performance
difference between using attributeValue("attr") and valueOf("@attr")?

It assume there is, which is why I asked for the numberAttributeValue().
If there is no performance difference, then your suggestion works
fine for me.

Silvain



_______________________________________________
dom4j-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dom4j-user

Reply via email to