commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Lenz <>
Subject [digester] [PATCH] New rule to build DOM nodes
Date Wed, 11 Sep 2002 12:35:50 GMT
Hi again,

here's the patch I promised in my previous mail.

This patch adds a new Rule implementation to Digester: NodeCreateRule.
It can create DOM Element and DocumentFragment nodes that are populated 
with all XML content contained by the matching element, and pushed on 
Digester's object stack.

A use case for this would be: you want to process XML documents that 
allow "ANY" content under certain nodes. Using a NodeCreateRule, 
Digester can capture that information in a DOM node for further 
processing by the application. Specifically, I've needed this 
functionality to process WebDAV XML request bodies. There's also been a 
request by Jim Birchfield on the commons-user mailing list:

Included in the patch is the NodeCreateRule class with full javadocs, as 
well as a corresponding test-case and a modification to build.xml to 
include that test-case. *Note that this patch depends on the changes 
I've sent in my previous patch*

There's one thing that seems weird to me: trying to run the unit tests 
using Maven, the NodeCreateRule tests failed with an 
IncompatibleClassException. That might be something strange with my 
environment, or a bug in Maven. The unit tests run fine using vanilla 
ant or eclipse.

Christopher Lenz
/=/ cmlenz at

View raw message