xsl-list
[Top] [All Lists]

Re: [xsl] XPath for expressing contiguous elements?

2017-05-01 08:19:49


On 01.05.17 15:13, Syd Bauman s(_dot_)bauman(_at_)northeastern(_dot_)edu wrote:
But if what you really want is a simple Schematron test, then

| <sch:rule context="A">
|   <sch:report 
test="following-sibling::B[following-sibling::A]">oops</sch:report>
| </sch:rule>

has the advantage of simplicity, but the disadvantage that it will
fire multiple times (twice for your example) rather than just once.
You can reduce the number of times that it fires with

Or let it fire in the context of Text, like Roger’s initial version:

<sch:rule context="Test">
<sch:report test="A[following-sibling::*[not(self::A)][following-sibling::A]]"> All A's
    shall be contiguous within Test. </sch:report>
</sch:rule>

–Gerrit
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--

<Prev in Thread] Current Thread [Next in Thread>