You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Christopher Lenz <cm...@gmx.de> on 2002/09/11 14:35:50 UTC

[digester] [PATCH] New rule to build DOM nodes

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:

http://nagoya.apache.org/eyebrowse/ReadMsg?listName=commons-user@jakarta.apache.org&msgNo=399

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.

Opinions?
-- 
Christopher Lenz
/=/ cmlenz at gmx.de