[ http://issues.apache.org/jira/browse/COCOON-648?page=all ] Helma van der Linden reopened COCOON-648: -----------------------------------------
reopened just to set the resolution to fixed > [PATCH] SchematronValidator incorrectly creates JXPath contexts which breaks > tests in schemas > --------------------------------------------------------------------------------------------- > > Key: COCOON-648 > URL: http://issues.apache.org/jira/browse/COCOON-648 > Project: Cocoon > Type: Bug > Components: - Components: Avalon > Versions: 2.1.8-dev (Current SVN) > Environment: Operating System: All > Platform: All > Reporter: Johan Stuyts > Assignee: Cocoon Developers Team > Attachments: 2003-04-17SchematronValidatorRuleContexts.patch > > Currently in Schematron schemas it is not possible to use the parent context > in > tests of a rule. Because of this it is not possible to make inter-element > tests > and have the violations assigned to a specific element. > For example: > /newLogin/password > /newLogin/repeatedPassword > If the repeated password does not match a violation should be added. > <rule context="/newLogin/repeatedPassword"> > <assert test="string(.) = string(../password)">Passwords must be the > same</assert> > </rule> > Should result in the following violation: > path = /newLogin/repeatedPassword > message = Passwords must be the same > The problem is in the 'evalRule' method of the 'SchematronValidator' class. > To > create the local JXPath context for this rule 'JXPathContext.newContext(...)' > is used currently. If this statement is replaced > with 'jxpContext.getRelativeContext(...)' the parent context can be used. > I do not know what the semantic differences between 'newContext' > and 'getRelativeContext' are. I can not tell if this change would break > something. > I will add a patch to this bug report. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira
