commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Allen,Eva" <>
Subject [Digester] Can digester match an unknown element?
Date Thu, 27 Mar 2008 09:22:42 GMT
We are working with an entity which sometimes adds new xml elements
without remembering to tell us about them.  We would like to be able to
log a warning whenever we encounter an element that we don't know about.
Is there any way to do this with digester?

Specifically, we have really simple xml files that in essence, look like
    <good>acceptedValue1< /good>
    <bad>rejectedValue1< /bad>

and the digester rules file looks like this:
    <pattern value="xmlrecord">
	do some stuff
	<pattern value="good">
	    do more stuff
	<pattern value="bad">
	    do even more stuff

All of a sudden one day, we got an "xmlrecord" with an "unworthy"
element (names have been changed here to protect the innocent).   We
would have liked to log a warning that we didn't know what to do with an
unworthy element, but I can find no way to tell digester how to parse
that.  I've tried patterns "xmlrecord/*" and "*/*" but neither one of
those works.  I've looked at the digester documentation including the
wiki page.  Everybody talks about generalized pattern matching but
nobody talks about unknown elements.  Is there any way to do this with

Eva Allen
Consulting Software Engineer, OCLC, Inc.
6565 Kilgour Pl., Dublin, OH  43017
614.764.6009 |
Views contained herein are my own; they do not necessarily reflect those
of my employer

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

View raw message