name = arg[ 0 ]
item = context.item
if isDocument( item ) :
- return Sequence( item.attributesByName.get( name , () ) )
+ if name == '*' :
+ attrs = sum( item.attributesByName.values() , [] )
+ attrs.sort( lambda a , b : cmp( a.position , b.position ) )
+ return Sequence( attrs )
+ else :
+ return Sequence( item.attributesByName.get( name , () ) )
else :
- return Sequence( attribute
- for attribute in iterDescendantOrSelfFull( item )
- if isAttribute( attribute ) and attribute.name == name )
+ if name == '*' :
+ return Sequence( attribute
+ for attribute in iterDescendantOrSelfFull( item )
+ if isAttribute( attribute ) )
+ else :
+ return Sequence( attribute
+ for attribute in iterDescendantOrSelfFull( item )
+ if isAttribute( attribute ) and attribute.name == name )
#--[ XPath/XQuery functions ]------------------------------------------------