How to write a schematron to ensure list-items are alphanumeric?

75 views Asked by At

Is it possible to use schematron to ensure that the list items are in alphanumeric order?

<ul>
    <li>1</li>
    <li>a</li>
    <li>d</li>
    <li>g</li>
</ul>

Many thanks!

1

There are 1 answers

0
sergioFC On BEST ANSWER

Yes, it is possible. You can use something like this example rule that reports all <li> elements whose value is lower than (lt) their previous <li> sibling value.

<sch:rule context="li">
    <sch:report test=". lt preceding-sibling::li[1]">
        This li value is lower than his previous li sibling value.
    </sch:report>
</sch:rule>