---
title: Style Test
description: "Migrate is typically used to convert documents from a highly-styled visual authoring environment to semantic XML. Documents therefore often have styles carefully applied to them such as *Heading1, Heading2, Heading3* for titles at different levels. The style test is used…"
url: "https://www.stilo.com/docs/migrate/types-of-tests-used-in-rules/style-test/"
updated: "2021-04-25"
category: Rules / Types of Tests Used in Rules
tags:
  - Rules
---

# Style Test

Migrate is typically used to convert documents from a highly-styled visual authoring environment to semantic XML. Documents therefore often have styles carefully applied to them such as *Heading1, Heading2, Heading3* for titles at different levels. The style test is used to check the styling of an element.

*Example: simple style test*

[![simple style test](https://www.stilo.com/wp-content/uploads/2021/03/style-test.png)](https://www.stilo.com/wp-content/uploads/2021/03/style-test.png)

*Example: style test with a pattern*

A style test accepts a pattern as its argument. A simple text string, as shown in the previous example, is a very simple pattern, but more complex patterns are allowed. The following rule will match text styled anything from *Heading1* to *Heading99* and apply the appropriate topic annotation. For example, *Heading3* text would be annotated as *p.title.topic(3)*. See [Patterns](https://www.stilo.com/docs/migrate/types-of-tests-used-in-rules/patterns/) for more information on patterns.

[![style test with a pattern](https://www.stilo.com/wp-content/uploads/2021/03/style-with-pattern-test.png)](https://www.stilo.com/wp-content/uploads/2021/03/style-with-pattern-test.png)

#### Prerequisite Concepts

- [Edit Mode](https://www.stilo.com/docs/migrate/getting-started-rules/edit-mode/)
- [Rule Conditions](https://www.stilo.com/docs/migrate/getting-started-rules/rule-conditions/)

#### Supporting Reference Material

- [Property Test](https://www.stilo.com/docs/migrate/types-of-tests-used-in-rules/property-test/)
- [Logical Group Test](https://www.stilo.com/docs/migrate/types-of-tests-used-in-rules/logical-group-test/)
- [Content Test](https://www.stilo.com/docs/migrate/types-of-tests-used-in-rules/content-test/)
- [Context Test](https://www.stilo.com/docs/migrate/types-of-tests-used-in-rules/context-test/)
- [Contains Element Test](https://www.stilo.com/docs/migrate/types-of-tests-used-in-rules/contains-element-test/)
- [Patterns](https://www.stilo.com/docs/migrate/types-of-tests-used-in-rules/patterns/)

#### Related Tasks

- [Deleting a Rule](https://www.stilo.com/docs/migrate/editing-rules/deleting-a-rule/)
- [Turning a rule on or off](https://www.stilo.com/docs/migrate/editing-rules/turning-a-rule-on-or-off/)
- [Commenting a rule](https://www.stilo.com/docs/migrate/editing-rules/commenting-a-rule/)
- [Adding a Test in a Condition](https://www.stilo.com/docs/migrate/editing-rules/adding-a-test-in-a-condition/)
- [Deleting a Test From a Condition](https://www.stilo.com/docs/migrate/editing-rules/deleting-a-test-from-a-condition/)
- [Moving a Test in a Condition](https://www.stilo.com/docs/migrate/editing-rules/moving-a-test-in-a-condition/)
- [Adding an Annotation](https://www.stilo.com/docs/migrate/editing-rules/adding-an-annotation/)
- [Deleting an Annotation](https://www.stilo.com/docs/migrate/editing-rules/deleting-an-annotation/)
- [Moving an Annotation](https://www.stilo.com/docs/migrate/editing-rules/moving-an-annotation/)
