Return-Path: Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 98910 invoked by uid 500); 24 Jul 2003 18:20:25 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: dev@cocoon.apache.org Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 98766 invoked from network); 24 Jul 2003 18:20:23 -0000 Received: from mail.networktelephone.net (HELO pflnocsr.networktelephone.net) (216.107.65.168) by daedalus.apache.org with SMTP; 24 Jul 2003 18:20:23 -0000 Received: From PFLNOCZR.NETWORKTELEPHONE.NET (10.255.241.34[10.255.241.34 port:1440]) by pflnocsr.networktelephone.net Mail essentials (server 2.422) with SMTP id: <37780@pflnocsr.networktelephone.net> for ; Thu, 24 Jul 2003 1:14:49 PM -0500 smtpmailfrom Received: by pflnoczr.corp.com with Internet Mail Service (5.5.2653.19) id ; Thu, 24 Jul 2003 13:15:12 -0500 Message-ID: From: Jonathan Spaeth To: "'dev@cocoon.apache.org'" Subject: RE: Advanced form validation using jxforms Date: Thu, 24 Jul 2003 13:15:11 -0500 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C3520F.85D08C10" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_001_01C3520F.85D08C10 Content-Type: text/plain Well, I have solved my own problem...it seems that jxpath has been upgraded since I last browsed the docs and java functions can be directly called from xpath. Therefore, with the jdk 1.4, I am able to do the following within my schema: Enter a the date and time. Enter the date and time in the proper format. Just thought I'ld share the solution to the problem I posted regarding validation using regular expressions! Jon -----Original Message----- From: Jonathan Spaeth [mailto:Jonathan.Spaeth@networktelephone.net] Sent: Thursday, July 24, 2003 10:12 AM To: 'dev@cocoon.apache.org' Subject: Advanced form validation using jxforms I have been working on a set of cocoon apps for the past three or four months now. The basic idea is simple data management; replacing a large number of spreadsheets with sql-database-driven apps using cocoon and jxforms (originally xmlform, but I migrated when jxforms became available). The problem or issue I have recently come across is the need to do more advanced form validation than is easily doable with the standard set of xpath functions. Specifically, if some type of regular expressions functionality were available to the schematron validator system, the validation system would be much more powerful. Currently, (as far as I know; please correct me if I'm wrong), the only way to register a jxpath extension function is by manipulating java code. If the validator classes were modified to ... Say ... Register a java class to use as a jxpath extension function by associating it with a namespace within the schematron xml document, I believe we could obtain some regular expression matching or validation within the jxforms validator. Any questions or suggestions or comments? Jon ------_=_NextPart_001_01C3520F.85D08C10 Content-Type: text/html Message
Well, I have solved my own problem...it seems that jxpath has been upgraded since I last browsed the docs and java functions can be directly called from xpath.
 
Therefore, with the jdk 1.4, I am able to do the following within my schema:
 
  <rule context="timestamp">
   <assert test="string-length(.) &gt; 0">Enter a the date and time.</assert>
   <!-- date format: mm-dd-yyyy hh:mi am|pm -->
   <assert test="java.util.regex.Pattern.matches('^\s*\d{2}-\d{2}-\d{4}\s+\d{1,2}:\d{2}\s+[ap]m\s*$', .)">Enter the date and time in the proper format.</assert>
  </rule>
Just thought I'ld share the solution to the problem I posted regarding validation using regular expressions!
 
Jon
-----Original Message-----
From: Jonathan Spaeth [mailto:Jonathan.Spaeth@networktelephone.net]
Sent: Thursday, July 24, 2003 10:12 AM
To: 'dev@cocoon.apache.org'
Subject: Advanced form validation using jxforms

I have been working on a set of cocoon apps for the past three or four months now. The basic idea is simple data management; replacing a large number of spreadsheets with sql-database-driven apps using cocoon and jxforms (originally xmlform, but I migrated when jxforms became available).

The problem or issue I have recently come across is the need to do more advanced form validation than is easily doable with the standard set of xpath functions.  Specifically, if some type of regular expressions functionality were available to the schematron validator system, the validation system would be much more powerful.

Currently, (as far as I know; please correct me if I'm wrong), the only way to register a jxpath extension function is by manipulating java code.  If the validator classes were modified to ... Say ... Register a java class to use as a jxpath extension function by associating it with a namespace within the schematron xml document, I believe we could obtain some regular expression matching or validation within the jxforms validator.

Any questions or suggestions or comments?

Jon

------_=_NextPart_001_01C3520F.85D08C10--