Is it possible to control the order of the attribute values in Relax NG? which can be achieved using xs:assert in schema?
XML:
<body>
<h1 class="title">title</h1>
<h2 class="subtitle">subtitle</h2>
<p class="paragraph1">para text 1</p>
<p class="paragraph2">Para text 2</p>
<p class="paragraph3">Para text 2</p>
</body>
The class value should be in order, paragraph1 should always come first and paragraph2 should come after paragraph1. The assert I tried in schema:
<xs:assert test="p[1]/@class = 'paragraph1'
and ((every $i in p[2] satisfies $i/@class = 'paragraph2')
and (every $i in p[3] satisfies $i/@class = 'paragraph3')) "/>
A (compact-syntax) RelaxNG grammar to express what the question describes could be written as:
Expressed in the RelaxNG XML syntax: