Menu

#671 Schematron mis-tests whitespace for separator (@targert,@from,@to)

GREEN
closed-fixed
None
3
2014-06-30
2014-05-23
Syd Bauman
No

The Schematron test to ensure (link/@target, join/@target) or prohibit (span/@from,span/@to) two pointers incorrectly tests whether or not the value of the attribute contains a blank. It should test whether the space-normalized value contains a blank. (Plus the wording of the former includes an attribute that, very sadly IMHO, no longer exists.) I.e.

  ﹤sch:assert test="contains(@target,' ')"﹥You must supply at least two values for  @target or @targets on ﹤sch:name/﹥﹤/sch:assert﹥

and

  ﹤report xmlns="http://purl.oclc.org/dsdl/schematron" test="contains(@to,' ') or contains(@from,' ')"﹥The attributes @to and @from on ﹤name/﹥ may each contain only a single value﹤/report﹥

should read something like

  ﹤sch:assert test="contains( normalize-space(@target),' ')"﹥You must supply at least two separate URI values for @target on ﹤sch:name/﹥﹤/sch:assert﹥

and

  ﹤sch:report test="contains( normalize-space(@to),' ') or contains( normalize-space(@from),' ')"﹥The attributes @to and @from on ﹤name/﹥ may each contain only a single URI﹤/report﹥

If we don't use normalize-space(), then two problems occur: 1) single values that start or end with whitespace get incorrectly flagged; 2) multiple values that are separated by only a linefeed don't get flagged.

I also don’t wonder if we should separate the tests for @to and @from, so the user is told precisely where the problem is. That’s another ticket (and a feature request rather than a bug, maybe?) for another day, I guess.

Discussion

  • Syd Bauman

    Syd Bauman - 2014-05-23

    P.S. Files affected:
    * Source/Specs/join.xml
    * Source/Specs/link.xml
    * Source/Specs/span.xml

     
  • Hugh A. Cayless

    Hugh A. Cayless - 2014-05-23
    • assigned_to: Hugh A. Cayless
     
  • Hugh A. Cayless

    Hugh A. Cayless - 2014-06-30
    • Group: AMBER --> GREEN
     
  • Hugh A. Cayless

    Hugh A. Cayless - 2014-06-30
    • status: open --> closed-fixed
     
  • Hugh A. Cayless

    Hugh A. Cayless - 2014-06-30

    Fixed with r12918.