----- Original Message -----
From: "Robert Kromkamp" <[EMAIL PROTECTED]>
To: "Jeroen Cranendonk" <[EMAIL PROTECTED]>
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to