This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 179350 - Validator does not support prefix matching
Summary: Validator does not support prefix matching
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Cosmos (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P1 normal (vote)
Target Milestone: ---   Edit
Assignee: amehrega CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-26 14:07 EDT by David Whiteman CLA
Modified: 2012-01-03 13:46 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Whiteman CLA 2007-03-26 14:07:31 EDT
The SML-IF spec indicates that documents can be matched using a prefix of the alias.  For instance, with the following rule binding:

     <ruleBinding>
    	<documentAlias>Student</documentAlias>
    	<ruleAlias>Rule</ruleAlias>
    </ruleBinding>

all rules that have an alias beginning with "Rule" (e.g. "Rule1", "RuleFoo", etc.) will be bound to all documents with an alias beginning with "Student" (e.g. "Student2", "StudentBar", etc.).  

Currently, the validator only does an exact match on the alias name.  The validator uses a Map object to bind the aliases.  Unfortunately, you can't look up Map values usign wildcards as keys.  So, the internal structure will need to change so the alias lookup is treated as a wildcard match.
Comment 1 Valentina Popescu CLA 2007-03-26 15:01:02 EDT
David, the actual match is not done at the string level, but URI prefix level.

In the sample below, if the document alias is Student, then the rule can be applied to a\Student, a\b\c\Student, but NOT a\StudentConf

We've discussed this off line and although I agreed that your sample is valid, I missed the fact that you are trying to append ( and actually prepend in this case ) strings and not URI prefixs to do the match


See section 2.3 in the SMLIF spec
Comment 2 Valentina Popescu CLA 2007-03-26 16:50:01 EDT
David,


The sample I used in comment #1 is wrong; I meant to exemplify by defining the URI with ‘Student’ as a prefix and not suffix; sorry for the confusion..

So read comment#1 as below :

David, the actual match is not done at the string level, but URI prefix level.

In your sample, if the document alias is Student, then the rule can be
applied to Student/a, Student/a/b/c, but NOT Studenta or Studentab/c

What I am trying to say is that the prefix presented in the document or rule alias is an URI PREFIX and not a simple string.

We've discussed this off line and although I agreed that your sample is valid, I missed the fact that you are trying to append strings and not URI fragments to do the match


See section 2.3 in the SMLIF spec
Comment 3 David Whiteman CLA 2007-03-26 17:54:20 EDT
Ok, here's a better example that I can get to fail.

  <ruleBindings>
     <ruleBinding>
    	<documentAlias>Student</documentAlias>
    	<ruleAlias>StudentIDRule</ruleAlias>
    </ruleBinding>
  </ruleBindings>

where there are three documents that should match that alias prefix:

          <alias>Student/Person1</alias>
          <alias>Student/Person2</alias>
          <alias>Student/Person3</alias>

Person3 should fail the schematron rule.  Only if I change the bindings as follows do I see a failure message:

	<documentAlias>Student</documentAlias>
	
That looks like a bug, correct?
Comment 4 Valentina Popescu CLA 2007-03-26 22:29:14 EDT
Re comment #3 : correct, this is a bug
Comment 5 Valentina Popescu CLA 2007-11-29 13:52:21 EST
moving target to i8
Comment 6 Valentina Popescu CLA 2008-03-03 12:41:07 EST
Ruth,
I am moving this to you so that you can reassign as you find appropriate
Comment 7 David Whiteman CLA 2008-06-25 15:02:20 EDT
since this should be done in i12, moving to p1
Comment 8 amehrega CLA 2008-08-27 17:24:52 EDT
Taking over defect
Comment 9 amehrega CLA 2008-08-27 22:14:33 EDT
Fix checked into CVS - HEAD.
Test case: Rules/InValidRuleBindingWithPrefix.xml
Comment 10 David Whiteman CLA 2008-11-05 15:00:13 EST
closing to cleanup bugzilla