Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 94795 invoked from network); 21 May 2004 17:25:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 21 May 2004 17:25:02 -0000 Received: (qmail 97870 invoked by uid 500); 21 May 2004 17:24:56 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 97788 invoked by uid 500); 21 May 2004 17:24:55 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 97687 invoked by uid 98); 21 May 2004 17:24:52 -0000 Received: from niall.pemberton@blueyonder.co.uk by hermes.apache.org by uid 82 with qmail-scanner-1.20 (clamuko: 0.70. Clear:RC:0(195.188.213.9):. Processed in 0.133523 secs); 21 May 2004 17:24:52 -0000 X-Qmail-Scanner-Mail-From: niall.pemberton@blueyonder.co.uk via hermes.apache.org X-Qmail-Scanner: 1.20 (Clear:RC:0(195.188.213.9):. Processed in 0.133523 secs) Received: from unknown (HELO smtp-out6.blueyonder.co.uk) (195.188.213.9) by hermes.apache.org with SMTP; 21 May 2004 17:24:52 -0000 Received: from DELL1800 ([82.43.172.127]) by smtp-out6.blueyonder.co.uk with Microsoft SMTPSVC(5.0.2195.5600); Fri, 21 May 2004 18:24:34 +0100 Message-ID: <003401c43f58$e29d2d40$7fac2b52@DELL1800> From: "Niall Pemberton" To: "Jakarta Commons Developers List" References: <20040521125902.39311.qmail@web50608.mail.yahoo.com> <40AE3143.2010907@twdata.org> Subject: Re: [validator] Schematron-type/XPath Validator Date: Fri, 21 May 2004 18:27:26 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 X-OriginalArrivalTime: 21 May 2004 17:24:34.0342 (UTC) FILETIME=[7C026460:01C43F58] X-Spam-Rating: hermes.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Given all the recent furore over collections is JXPath's dependency on it due to Beanutils or does it use collections classes directly? Also I was surprised JXPath depends on the servlet api and is this a dependancy validator is OK to inherit? http://jakarta.apache.org/commons/jxpath/dependencies.html Niall ----- Original Message ----- From: "Don Brown" To: "Jakarta Commons Developers List" Sent: Friday, May 21, 2004 5:41 PM Subject: Re: [validator] Schematron-type/XPath Validator > Yeah, I think putting it in contrib as Robert suggested might be a good > start, however even if it shipped with Validator, it wouldn't be needed > unless you wanted to use the jxpath validator. XPath is basically an > expression language to locate nodes. While intended for XML documents, > JXPath makes it possible to use it with JavaBeans, DynaBeans, and a > bunch more. In addition to node location syntax, XPath includes various > functions like the number() one in my example. > > A XPath tutorial: > http://www.zvon.org/xxl/XPathTutorial/General/examples.html > XPath functions: > http://www.devguru.com/Technologies/xslt/quickref/xslt_index_functions.html > > Of course this validator wouldn't be for everyone, particularly those > with no XPath knowledge, but for those of us that work with it every > day, it allows us to re-use that knowledge to do complex things quickly > and efficiently. One less language/syntax to learn is a good thing! :) > > Don > > David Graham wrote: > > >This sounds interesting but I don't know anything about XPath so a more in > >depth example would be useful. I'm also worried about adding another > >dependency; maybe this could be an optional download? > > > >David > > > >--- Don Brown wrote: > > > > > >>I wrote a simple Validator that uses JXPath to implement a > >>schematron-style validation where fields are evaluated against boolean > >>XPath expressions. The idea is from the XMLForms project > >>(http://www.xmlform.org), previously of Cocoon. JXPath makes it easy to > >> > >>write complex validations on many types of objects that can span object > >>trees. > >> > >>The initialization of the validator looks like this: > >> > >> >> > >>classname="org.apache.commons.validator.JXPathValidator" > >> method="isValid" > >> > >>methodParams="java.lang.Object,org.apache.commons.validator.Field" > >> msg=""/> > >> > >>and a sample usage: > >> > >> > >> > >> test > >> number(.) > 0 and number(.) < 10 > >> > >> > >> > >>The test variable contains the xpath expression to evaluate. The > >>"property" attribute contains the xpath expression to narrow the scope > >>of the tested xpath. Thanks to JXPath, this validator works on many > >>different types of Java objects, including JavaBeans, and can handle > >>field property xpath expressions that match multiple "nodes" or values. > >> > >>If this validator would be useful for the commons-validator project, I > >>can supply code for the validator, unit tests, and any patches to > >>existing files, through bugzilla of course. > >> > >>Don > >> > >>--------------------------------------------------------------------- > >>To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org > >>For additional commands, e-mail: commons-dev-help@jakarta.apache.org > >> > >> > >> > > > > > > > > > > > >__________________________________ > >Do you Yahoo!? > >Yahoo! Domains � Claim yours for only $14.70/year > >http://smallbusiness.promotions.yahoo.com/offer > > > >--------------------------------------------------------------------- > >To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org > >For additional commands, e-mail: commons-dev-help@jakarta.apache.org > > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org > For additional commands, e-mail: commons-dev-help@jakarta.apache.org > > > --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org