# ModelSchemaContextItem

interface

An item of the [schema context](module_engine_model_schema-ModelSchemaContext.md).

It contains 3 properties:

* `name` – the name of this item,
* `* getAttributeKeys()` – a generator of keys of item attributes,
* `getAttribute( keyName )` – a method to get attribute values.

The context item interface is a highly simplified version of [`ModelNode`](module_engine_model_node-ModelNode.md) and its role is to expose only the information which schema checks are able to provide (which is the name of the node and node's attributes).

```typescript
schema.on( 'checkChild', ( evt, args ) => {
	const ctx = args[ 0 ];
	const firstItem = ctx.getItem( 0 );

	console.log( firstItem.name ); // -> '$root'
	console.log( firstItem.getAttribute( 'foo' ) ); // -> 'bar'
	console.log( Array.from( firstItem.getAttributeKeys() ) ); // -> [ 'foo', 'faa' ]
} );
```

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-engine/src/model/schema.ts#L2069)

<a id="properties">

## Properties

<a id="member-name">

### `name: string`

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-engine/src/model/schema.ts#L2070)

<a id="methods">

## Methods

<a id="function-getAttribute">

### `getAttribute( keyName ) → unknown`

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-engine/src/model/schema.ts#L2072)

#### Parameters

* `keyName: string`

#### Returns

* `unknown`

<a id="function-getAttributeKeys">

### `getAttributeKeys() → Generator<string>`

[See source](https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-engine/src/model/schema.ts#L2071)

#### Returns

* `Generator<string>`

---

Full index of the CKEditor 5 API reference: [llms.txt](llms.txt)
