Attributes in array elements and support for complex extensions with array elements

Fixes two issues:

1) Support for attributes in array elements. Please refer to #291 for details. Credit goes to @bertop89 for this fix.
2) Fix for finding the correct namespace for complex extensions with array elements.