You can configure Acrolinx to include the values of attributes when sending text to the server for checking. You can use this feature in combination with customized style rules to validate the values of specific attributes. You can also use this feature to check attributes that contain sentences or keywords such as meta content. For more information on developing style rules to validate attribute values, contact your Acrolinx project consultant.
To define the attributes for checking, you add the property extract_attributes to a CSD file . The Batch Checker also comes installed with a sample CSD file for HTML with the name "HTML_SEO". This CSD file contains a sample configuration for extracting meta descriptions for web pages and alternate text for images.
Extract the content of a specific attribute regardless of the element in which it appears.
The following example shows how to configure the Batch Checker to extract and check the value of the name attribute:
extract_attributes=.nameThis configuration would extract the text "Header" and "Checking Statistics" from the following code excerpt.
<img name="Header" src="header.jpg /> <table name="Checking statistics">
Extract the content of a specific attribute when it is found in a specific element
The following example shows how to configure the Batch Checker to extract and check the value of the alt attribute within image elements:
extract_attributes=img.altThis configuration would extract the text "Options Menu" and "Configuration Window" from the following code excerpt.
<img alt="Options Menu" src="13682.jpg" /> <img alt="Configuration Window" src="3738.jpg" />It is also possible to develop style rules to check for empty attributes so that you can check for images where the alt attribute exists but is not defined.
Extract the content of a specific attribute only when the element contains another
attribute with a specific value. This syntax is useful for checking the content of meta tags
The following example shows how to configure the Batch Checker to extract and check the value of the content attribute from all meta elements as long as the meta element has the name "description".
Example: extract_attributes=meta.content#name=descriptionThis configuration would extract the text "Topspin is about making your business better." from the following code excerpt.
<meta name="Description" content="Topspin is about making your business better." />
To configure the Batch Checker to check attribute values, follow these steps:
Open a CSD file and add the following property with a list of comma-separated values.
The Batch Checker ignores case differences when interpreting this property. The values can have a different case to the element and attribute names in the documentTip: The extraction of attribute values is not influenced by the segmentation settings. You can define an attribute for checking even if it is attribute of an excluded element.
- Save and close the CSD file, then restart the Batch Checker for your changes to take effect.