You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Jeroen Cranendonk <j....@emaxx.nl> on 2003/03/11 16:13:37 UTC

Fw: XMLForm Validation

----- Original Message -----
From: "Robert Kromkamp" <ro...@emaxx.nl>
To: "Jeroen Cranendonk" <j....@emaxx.nl>
Sent: Tuesday, March 11, 2003 5:12 PM
Subject: XMLForm Validation


> Hi,
>
> A Zip code (in the Netherlands) consist of numbers and letters, like
1234AB.
> In the content XML this zip code is split up in 2 input elements, namely
> "zipcodenumbers" and "zipcodeletters". These elements are graphical placed
> behind each other. I know it's possible to do an individual validation of
> these elements. When the validation of an element will fail, an error text
> is shown behind the specific input element. Cause the zipcode number and
> letter can functional be seen as one component, i want to validate them
> together and show only one error message ("Zipcode is required") for both.
> Who can help me?
>
> Beneath I've given the structure of my current schema ...
>
> <schema ns="http://xml.apache.cocoon/xmlform"
>       xmlns="http://www.ascc.net/xml/schematron">
> <title>Schema for excerpt</title>
>
> <phase id="personaldetails">
> <p>personaldetails information.</p>
> <active pattern="personaldetailsPattern"/>
> </phase>
>
> <pattern name="Personal Details Pattern" id="personaldetailsPattern">
> <rule context="/lastname">
> <assert test="string-length(.) &gt; 0">Lastname is required.</assert>
> </rule>
>
> <rule context="/zipcodenumbers">
> <assert test="/personalDetails/zipcodeletters">Zipcode numbers is
> required.</assert>
> </rule>
> <rule context="/zipcodeletters">
> <assert test="string-length(.) &gt; 0">Zipcode letters is
> required.</assert>
> </rule>
> </pattern>
> </schema>
>
> Many Thanks,
> Robert Kromkamp
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org