Artificial intelligence can be used to develop Schematron rules. Machine learning algorithms can be trained to recognize these patterns and generate Schematron rules that can be used to validate future XML documents.
The user can provide a prompt that describes the Schematron rule. He can describe a specific scenario or use case for which the Schematron rules will be created using AI. The AI will generate the rules based on the scenario he provides.
For example the user can provide a prompt like: "A Schematron assert that verifies the number of words to be 10". The generated content by the AI can be something like this:
<sch:assert test="count(tokenize(., '\s+')) = 10">There should be exactly 10.</sch:assert>
Another example of prompt can be to verify if the text contains an email. I this case the prompt can be something like: "A Schematron assert that verifies if there is an email in text". The content generated by the AI can be something like this:
<sch:assert test="matches(., '\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b')"> There is no email in the text</sch:assert>