cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeroen Cranendonk" <j.cranend...@emaxx.nl>
Subject Fw: XMLForm Validation
Date Tue, 11 Mar 2003 15:13:37 GMT

----- Original Message -----
From: "Robert Kromkamp" <robert@emaxx.nl>
To: "Jeroen Cranendonk" <j.cranendonk@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


Mime
View raw message