This Schematron rule is designed to check if a block of text should be converted to a list. It can be used to ensure that content is properly formatted and structured for readability and accessibility.
Example 12. Rule that verifies the text from a paragraph should be converted to a list
<sch:rule context="p"> <sch:report test="contains(., '- ')"> The text should be converted to a list</sch:report> </sch:rule>
If the rule detects that the text should be converted to a list, it can trigger a fix that generates an unordered or ordered list from the set of phrases. This can help to improve the organization and clarity of the content, making it easier for readers to understand and follow.
Example 13. SQF fix that creates a list from a set of phrases
<sqf:fix id="replace"> <sqf:description> <sqf:title>Create a list from the phrases from the paragraph</sqf:title> </sqf:description> <sqf:replace match="text()"> <xsl:value-of select="ai:transform-content( 'Create a Dita unorderd list with an item from each phrase', .)" disable-output-escaping="yes"/> </sqf:replace> </sqf:fix>
If the generated content contains markup you need to use the disable-output-escaping="yes" in order to insert the markup unescaped in the document.