commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Strachan <>
Subject [digester] warning of unknown elements and attributes
Date Wed, 16 Apr 2003 11:49:57 GMT
I'd like digester to be able to warn if a user makes a typeo in an XML 
document, typing the wrong element or attribute name. Often digester 
files have a dynamic schema based on the classes used (e.g. when 
overriding the implementation class of a bean, the properties can 
change) so using traditional fixed schema/DTD approaches don't work.

 From looking at the current digester code this looks fairly easily 
possible; I was just checking if anyone had figured out a way to do 
this anyway using the current RuleSet stuff. e.g. can you specify a 
rule to be fired only if no other rules are fired?

I was suspecting that the above wasn't possible and so was thinking of 
adding 2 callbacks into Digester for when no rule is found, or when 
some rules (like SetObjectProperties) finds an unknown attribute - so 
that applications can decide how best to treat these warning 
conditions. Then the default implementation of these methods could just 
do some logging of a warning to commons-logging.

Has anyone attempted something like this before (just trying to avoid 
duplicating work). Or any other thoughts on this?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message