cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Helma van der Linden (JIRA)" <j...@apache.org>
Subject [jira] Reopened: (COCOON-984) [PATCH] context of violation in schema validator of jxforms fixed
Date Tue, 25 Oct 2005 14:04:57 GMT
     [ http://issues.apache.org/jira/browse/COCOON-984?page=all ]
     
Helma van der Linden reopened COCOON-984:
-----------------------------------------


reopened just to set the resolution to fixed

> [PATCH] context of violation in schema validator of jxforms fixed
> -----------------------------------------------------------------
>
>          Key: COCOON-984
>          URL: http://issues.apache.org/jira/browse/COCOON-984
>      Project: Cocoon
>         Type: Bug
>   Components: Blocks: Forms
>     Versions: 2.1.8-dev (Current SVN)
>  Environment: Operating System: All
> Platform: All
>     Reporter: Boris Sachsenberg
>     Assignee: Cocoon Developers Team
>  Attachments: SchematronValidator.java.diff, SchematronValidator.java.diff
>
> When a schematron validation leads to a violation in a jxform the context of the
> violation was set wrong. As a result the violation is not inserted in the
> violation section of the element that coursed the violation. Instead it is only
> inserted into main violation section. Please see the following example for details:
> Form definition looks something like this:
> [..]
> <xf:form [..]>
>  <error>
>   <xf:violations class="error"/>
>  </error>  
>  <xf:input ref="/name">
>   <xf:label>Name:</xf:label>
>   <xf:violations class="error"/>
>  </xf:input>
>  [..]
> </xf:form>
> Schematron file:
> [..]
> <phase id="schema-login">
>  <active pattern="user"/>
> </phase>
> <pattern name="User Info Validation Pattern" id="user">
>  <rule context="/name">
>   <assert test="string-length(.) &gt; 2">Username should be at least 3
> characters.</assert>
>  </rule>
> </pattern>
> When entering name less than 3 chars before the patch we get:
> [..]
> <xf:form [..]>
>  <error>
>   <violation xmlns="http://apache.org/cocoon/jxforms/1.0" class="error"
> ref="/.[@name='name']">Username should be at least 3 characters.</violation>
>  </error> 
>  <xf:input ref="/name">
>   <xf:label>Name:</xf:label> 
>  </xf:input>
>  [..]
> </xf:form>
> After applying the patch now we get:
> [..]
> <xf:form [..]>
>  <error>
>   <violation xmlns="http://apache.org/cocoon/jxforms/1.0" class="error"
> ref="/name">Username should be at least 3 characters.</violation>
>  </error> 
>  <xf:input ref="/name">
>   <xf:label>Name:</xf:label> 
>   <violation xmlns="http://apache.org/cocoon/jxforms/1.0" class="error"
> ref="/name">Username should be at least 3 characters.</violation>
>  </xf:input>
>  [..]
> </xf:form>

-- 
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


Mime
View raw message