
sc:attribute-decl( [$arg as item()] ) as attribute-decl()?
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.
| Parameters | |
|---|---|
| arg | The item whose attribute declaration is to be returned. |
declare namespace xh="http://www.w3.org/1999/xhtml";
<decl>{sc:attribute-decl(
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>Example</title></head>
<body><p class="example">Example</p></body>
</html>//xh:p/@class)}</decl>;
=>
<decl>
<xs:attribute name="class" type="xs:NMTOKENS"
xmlns:xs="http://www.w3.org/2001/XMLSchema"/>
</decl>