Hi James!

> > Is there any buildup validation features in Dom4J?
> >
> > What I mean is that when the Document is created a 
> DTD/Schema is assigned
> to
> > the Document and as the element, attribute .. is added to 
> the document the
> > document is validating it's correctness.
> >
> 
> Firstly validating a document as its being created / changed 
> often doesn't work. e.g. an empty document will be invalid.

Well, no. During build up a invalid document is a document that breaks a
rule in the rule specification (i.e. dtd/schema a.s.o.)and a rule is not
broken when it is not fullfilled. 
This is the fundamental differens between build time validation and "normal"
validation.

Reason:
For example we have an old system that we need to expand and doing this with
modern component and ofcourse XML specified communication. The DB has been
around for a looooooooooooooooooong time *ihh nightmare* and things has been
added without to many (if any) constraints and rules. So the result from
data retrival all has to be validated to ensure that the information is
correct. No this would be easy if it was a small system, it is not only the
DB part I'm involved with (and it is a small part) is over 1200 tables.
Part of the system is just a information retrival and passing on system
where large querys retrives data transforms it into XML and sends it on.
Some of the XML is quite large and validation when it is completed is just
not possible (to slow and memory intens) so build validation is our only
solution to get away of the validation layer between query result and xml
building (and this layer is SOO boring to write). When invalidation occures
logical rules can adopt the information to fulfill validation and retrival
can continue without to much of a problem.
 
> Though once you have a Document instance you can validate it 
> against a DTD / schema whenever you wish.

Well ofcourse, but this don't help me...
 
> There's a cool library called MSV from Sun which does this 
> very nicely and
> it works against DTDs, RelaxNG (the nicest schema language 
> IMHO) as well as
> XML Schema, TREX and Relax.

I know, I have been using MSV for a while now and it is great... 
 
/Christian

_______________________________________________
dom4j-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dom4j-user

Reply via email to