cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremy Quinn <>
Subject Re: using Schemas for Form validation
Date Mon, 26 Jun 2000 08:51:26 GMT
At 21:40 +0200 25/06/00, Mark Washeim wrote:
>> i agree you shouldn't _rely_ on client-side validation using javascript,
>> but it's a really nice extra you can tack on to make things nicer for
>> clients that support it.
>> - donald
>I agree it's nice, but it's very difficult to maintain in a setting where
>the forms are maintained by a variety of people.

One idea that was floating around was to have the JavaScript auto
generated, not hand-written. We are auto-generating Java code, why not

I'm just struggling to get my head around generating JavaScripts from a
Schema right now :}


Getting back to the validation, using Schema.

No one expressed any problem in the use of RevalidatingDomParser to
validate my modifications on demand. Does that mean that I understood the
API correctly?

Is this confirmation that the validate(Node) method works with Schemas as
well as DTD?

What I do not understand .....

Let's say I am modifying a small section of a large XML file, I have the
name of the file, and an XPath to identify the node I wish to modify.

I make a modification, then pass this Node to validate(Node).

What gets validated? Just this Node or the whole file?

The DOM must know about the whole file, it has access to the Schema def.

Is it possible somehow to validate a single Element or Node? not the whole

Could I somehow supply the Schema definition _after_ I have parsed the
document and got the node using XPath? Otherwise the Schema Definition has
to be in the source file and may mean the file gets validated during normal
serving operations as well as editing operations.

validate(Node) returns "null" on success, and the closest Node to the error
on failure.
How do you find out what the actual problem is, so you can send back a
meaningful error message?


   Jeremy Quinn                                           Karma Divers
                                                       webSpace Design
                                            HyperMedia Research Centre

   <>     		 <>
    <phone:+44.[0].20.7737.6831>        <>

View raw message