<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/sc.attributeDecl.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>sc.attributeDecl</api:function-name><api:suggest>sc.attributedecl</api:suggest><api:suggest>sc</api:suggest><api:suggest>attributedecl</api:suggest><api:function-link mode="xquery" fullname="sc:attribute-decl">/apidoc/8.0/sc:attribute-decl.xml</api:function-link><api:function mode="javascript" name="attributeDecl" type="builtin" lib="sc" category="SchemaBuiltins" hidden="false" bucket="MarkLogic Built-In Functions" prefix="sc" namespace="http://marklogic.com/xdmp/schema-components" fullname="sc.attributeDecl"><api:summary>
  <p xmlns="http://www.w3.org/1999/xhtml">Returns the attribute declaration of item, as a schema component, if any.
  If the item has no attribute declaration, the empty sequence is returned.
  The context item is used if no argument is given.</p>
  <ul xmlns="http://www.w3.org/1999/xhtml"><li>If the item is an attribute node, the result is of its attribute
   declaration.</li><li>In other cases, the result is the empty sequence.</li></ul>
</api:summary><api:params><api:param name="arg" type="item()" optional="true"><api:param-description>
     The item whose attribute declaration is to be returned.
  </api:param-description><api:param-name>arg</api:param-name><api:param-type>String</api:param-type></api:param></api:params><api:return>attributeDecl()?</api:return><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
var th = xdmp.unquote('&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;'
+'    &lt;head&gt;&lt;title&gt;Example&lt;/title&gt;&lt;/head&gt;'
+'    &lt;body&gt;&lt;p class="example"&gt;Example&lt;/p&gt;&lt;/body&gt;'
+'  &lt;/html&gt;').next().value.root;
sc.attributeDecl(th.xpath("//xh:p/@class", {xh: "http://www.w3.org/1999/xhtml"} ));
=&gt;
@class
</pre></api:example></api:function></api:function-page>