cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Brown" <...@fivesight.com>
Subject RE: Cocoon Form binding and validation [was: RE: SchemoX forms]
Date Sun, 31 Mar 2002 21:27:25 GMT


> From: Mats Norén [mailto:mats@alma.nu]
> Subject: Re: Cocoon Form binding and validation [was: RE: SchemoX forms]
> The SaxErrorHandler can, to the best of my knowledge, NOT provide you with
> the XPath location of the bad element,
> a quick workaround is to implement a tag tracking Stack in the
> errorhandler.

You may get some different opinions, but here is my $0.02 worth from a SAX
perspective:  If you have a DOM, an XPath is not what you want -- you want
the actual org.w3c.dom.Node that caused the error.  If you're doing what you
describe with JavaBeans, then you want an object and a property.

So, what you really want is an implementation of org.xml.sax.Locator that
adds some extra set/get methods for the kind of location that you want, and
then you have to make sure that whatever you're using to walk the object
model updates the Locator implementation about the most recently visited
object.  (The DOM visitor implementation that is part of the JARV package is
a good example.)

	-- Paul


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


Mime
View raw message