<ROOTNODE>
<Blocks>
<Block>
<Ref/>
<BlockDates Start="2015-10-20" End="2015-10-25" />
<Types>
<Type TypeCode="SGL">
<TypeAllocations>
<TypeAllocation Start="2015-10-26" End="2015-10-27" />
<TypeAllocation Start="2015-10-26" End="2015-10-25" />
</TypeAllocations>
</Type>
<Type TypeCode="SGL">
<TypeAllocations>
<TypeAllocation Start="2015-10-28" End="2015-10-29" />
<TypeAllocation Start="2015-10-26" End="2015-10-27" />
</TypeAllocations>
</Type>
</Types>
</Block>
<Block>
<Ref/>
<BlockDates Start="2015-10-26" End="2015-10-30"/>
<Types>
<Type TypeCode="SG">
<TypeAllocations>
<TypeAllocation Start="2015-10-31" End="2015-11-01" />
<TypeAllocation Start="2015-10-25" End="2015-10-24" />
</TypeAllocations>
</Type>
<Type TypeCode="SG">
<TypeAllocations>
<TypeAllocation Start="2015-10-21" End="2015-10-25" />
<TypeAllocation Start="2015-10-23" End="2015-11-27" />
</TypeAllocations>
</Type>
</Types>
</Block>
</Blocks>
</ROOTNODE>
Я пытаюсь найти способ, чтобы сказать, если < TypeAllocation @start и @end > даты вне < BlockDates @start и @end > даты. Может быть любое количество < ТипAlocation > элементов и < Тип > элементов. Вышеизложенное не должно срабатывать во всех случаях. Ниже я попытался. Однако я чувствую, что это отходит, поскольку он только находит первый. Любая помощь очень ценится!Schematron Дата Сравнение
<sch:pattern name="Testing Start and End dates">
<sch:rule context="blk:InvBlock">
<sch:report test="translate(blk:InvBlockDates/@Start, '-', '') <= translate(blk:RoomTypes/blk:RoomType/blk:RoomTypeAllocations/blk:RoomTypeAllocation/@Start, '-', '') or translate(blk:InvBlockDates/@End, '-', '') <= translate(blk:RoomTypes/blk:RoomType/blk:RoomTypeAllocations/blk:RoomTypeAllocation/@End, '-', '')"> Allocation @Start and @End dates can not be outside the Block @Start and @End dates. </sch:report>
</sch:rule>
</sch:pattern>
Привет, Мартин, Да, мне нужно проверить все начальные и конечные даты распределения с-в блоке. Я забыл упомянуть, что я использую Schematron 1.5 с этим. Таким образом, функция current() не работает. – user1128792