> ## Documentation Index
> Fetch the complete documentation index at: https://docs.arc.cdata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# arc:equals

> Compares the value of an attribute to a reference value and executes the body block when they match, throwing an exception if the attribute does not exist.

Use the `arc:equals` keyword to compare the value of an attribute to a reference value. Unlike [arc:check](https://docs.arc.cdata.com/26.4/cloud/en/scripting/keyword-reference/op-arc-check.md), `arc:equals` throws an exception if the specified item does not contain the specified attribute. If the specified attribute exists and its value matches, the comparison succeeds.

> [!NOTE]
>
> `arc:equals` and `arc:check` both expect the name of the attribute whose value should be compared with a given value. To compare two values, you can use [arc:select](https://docs.arc.cdata.com/26.4/cloud/en/scripting/keyword-reference/op-arc-select.md) instead. For example:
>
> ```xml theme={null}
> <arc:select value="[company_name]">
>   <arc:case value="CompanyA">
>     <img src="http://www.companya.com/favicon.ico" />
>   </arc:case>
>   <arc:case value="CompanyB">
>     <img src="http://www.companyb.com/favicon.ico" />
>   </arc:case>
>   <arc:default>
>     <img src="http://www.myhosting.com/generic.ico"/>
>   </arc:default>
> </arc:select>
> ```

## Parameters

* **item**: The item in which to compare the attribute. Specifying an item is not required. If item is not specified, the default item is used.
* **attr**: The name of the attribute to compare.
* **case**: Whether to use case-sensitive or case-insensitive comparison. The default is case-sensitive comparison; to use case-insensitive comparison, set this parameter to `ignore`.
* **value**: The value to compare the attribute with.
* **action**: The action to perform if equality is met. Allowed values: `break` or `continue`.

## Control Attributes

None

## Example

Like other conditional keywords, the body of `arc:equals` can also contain an [arc:else](https://docs.arc.cdata.com/26.4/cloud/en/scripting/keyword-reference/op-arc-else.md) keyword, which is executed if the values do not match. The following lists all files except `.err` files:

```xml theme={null}
<arc:call op="fileListDir">
  <arc:equals attr="file:extension" value=".err">
  <arc:else>
    <arc:push/>
  </arc:else>
  </arc:equals>
</arc:call>
```

## See Also

* [arc:select](https://docs.arc.cdata.com/26.4/cloud/en/scripting/keyword-reference/op-arc-select.md): Choose between more than one alternative.
* [arc:notequals](https://docs.arc.cdata.com/26.4/cloud/en/scripting/keyword-reference/op-arc-not-equals.md): Create a block that is executed when equality is not met.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.