Definition of an attribute, closely related to DTD definition.

interface AttributeDefinitionConfig {
    content?: AttributeContent;
    fixed?: null | string;
    localName: string;
    namespaceURI?: null | string;
    prefix?: null | string;
    required?: string | false;
    validateValue?: ((value, strictness) => boolean);
}

Properties

Defines valid attribute value types.

fixed?: null | string

If the value is fixed. It is expected that at least strict validation would consider any other value despite the fixed value as invalid.

localName: string

The local name of an attribute.

namespaceURI?: null | string

Namespace URI of attribute. If unset, it may be guessed from prefix if it is a well-known prefix.

prefix?: null | string

The prefix of an attribute. null none.

required?: string | false

If required and missing: Use the given value as default value.

validateValue?: ((value, strictness) => boolean)

Validate a given value. By default forwards to attribute content definition.

Type declaration

    • (value, strictness): boolean
    • Parameters

      • value: null | string

        value to validate

      • strictness: ActiveStrictness

        strictness level to respect

      Returns boolean