You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Sonny Sukumar <ah...@hotmail.com> on 2003/09/01 02:00:54 UTC

Reg exp validation with Woody?

I'm looking for a solution to generate forms for every page of a checkout 
process on an e-commerce site, and so I started looking at Woody.  I realize 
it's a work in progress, but I figure if there's a sample of its use in 
Cocoon 2.1 (which I'm using), it might just be able to do the job.

But I'm wondering if I can do field validation with it using regular 
expressions.  I looked at this Wiki page and the one it links to on 
validation syntax, and I didn't see anything about it:

http://wiki.cocoondev.org/Wiki.jsp?page=WoodyNotes

Thanks,

Sonny

_________________________________________________________________
Get MSN 8 and help protect your children with advanced parental controls.  
http://join.msn.com/?page=features/parental


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


Re: Reg exp validation with Woody?

Posted by Bruno Dumon <br...@outerthought.org>.
On Mon, 2003-09-01 at 02:00, Sonny Sukumar wrote:
> I'm looking for a solution to generate forms for every page of a checkout 
> process on an e-commerce site, and so I started looking at Woody.  I realize 
> it's a work in progress, but I figure if there's a sample of its use in 
> Cocoon 2.1 (which I'm using), it might just be able to do the job.
> 
> But I'm wondering if I can do field validation with it using regular 
> expressions.

Yep you can. The following is taken from the "form1" example of Woody:

  <wd:field id="ipaddress" required="true">
    <wd:label>Please enter your IP address</wd:label>
    <wd:datatype base="string">
      <wd:validation>
        <wd:regexp
pattern="^([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5])$">
          <wd:failmessage>Invalid IP address.</wd:failmessage>
        </wd:regexp>
      </wd:validation>
    </wd:datatype>
  </wd:field>

>   I looked at this Wiki page and the one it links to on 
> validation syntax, and I didn't see anything about it:
> 
> http://wiki.cocoondev.org/Wiki.jsp?page=WoodyNotes

It's documented over here:

http://wiki.cocoondev.org/Wiki.jsp?page=WoodyReference

just search for "regexp".

-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org                          bruno@apache.org


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