Project

Profile

Help

Bug #4444

closed

Problem with count(//parent::node()) and schematron comparison operators

Added by Jordan Padams almost 5 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Internals
Sprint/Milestone:
-
Start date:
2020-01-28
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
9.5, 9.9, trunk
Fix Committed on Branch:
9.9, trunk
Fixed in Maintenance Release:
Platforms:

Description

Beginning with Saxon HE 9.5.1-4, the library no longer properly handles the use of count(//parent::node()) properly when doing comparisons in schematron.

Oddly enough, if you output the value in the assert using value-of, it is successful. For example:

This asserts:

  <sch:pattern>
    <sch:rule context="sp:Bin_Center_Lookup/sp:bin_center_field_name">
      <sch:let name="cnt2" value="count(//parent::node())" />
      <sch:assert test="$cnt2 eq 379">
        Test1 No output count</sch:assert>
    </sch:rule>
  </sch:pattern>

While this works as expected:

  <sch:pattern>
    <sch:rule context="sp:Bin_Center_Lookup/sp:bin_center_field_name">
      <sch:let name="cnt2" value="count(//parent::node())" />
      <sch:assert test="$cnt2 eq 379">
        Test2 Output count: <sch:value-of select="$cnt2"/></sch:assert>
    </sch:rule>
  </sch:pattern>

Example files for validation attached.

We may just be somehow calling the schematron incorrectly from our libraries, but this appears to be the only place where we are running into issues.


Files

PDS4_SP_TEST.sch (1.9 KB) PDS4_SP_TEST.sch Test schematron Jordan Padams, 2020-01-28 21:21
SP-Test1-VALID.xml (33.1 KB) SP-Test1-VALID.xml Test XML Jordan Padams, 2020-01-28 21:21

Please register to edit this issue

Also available in: Atom PDF