|-
| valign='top' width='90' | '''Signatures'''
|<code><b>db:attribute</b>($string as item()) as attribute()*</code> <font color="red">Version < 6.7</font><br/><code><b>db:attribute</b>($string as item(), $attname as xs:string) as attribute()*</code> <font color="red">Version < 6.7</font><br/><code><b>db:attribute</b>($name as xs:string, $string as item()) as attribute()*</code> <font color="red">Version 6.7</font><br/><code><b>db:attribute</b>($name as xs:string, $string as item(), $attname as xs:string) as attribute()*</code> <font color="red">Version 6.7</font>
|-
| valign='top' | '''Summary'''
|Returns all attribute nodes that have <code>$string</code> as their string value.<br />If <code>$attname</code> is specified, the resulting attribute nodes are filtered by their attribute name.
|-
| valign='top' | '''Errors'''
|<b>[[XQuery Errors#BaseX Errors (BASX)|BASX0002]]</b> is raised if the context item does not represent a database node. <font color="red">Version < 6.7</font>
|-
| valign='top' | '''Examples'''