commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rich coco <rac...@starbak.com>
Subject parsing xmlrpc message
Date Wed, 21 Jul 2004 15:23:38 GMT

I am attempting to use Digester (Jakarta Commons) to parse an xmlrpc
message. The format of the incoming xmlrpc is some what peculiar to the
company sending it (I am looking at a response to a sent command request).

The details:

     * there is only 1 <param> coming back: a structure.

     * Each <member> element of this single "top-level" structure is also (always) a
       structure. That is, no primitive type is returned at this 'secondary level'

     *  Each of these secondary strucutures can, arbitrarily, have members that are
        primitives, structures, or arrays of said types. This can, in principle, be
        arbitrarily deep.

My difficulty is that I believe I need some kind of recursive pattern-matching capability
in order to properly handle the general case. However, I cannot see any way to do this
using Digester. I am hoping this is a reflection of my inexperience with Digester
and not a limitation of that package itself.

The Digester "method" I can imagine helping with this involves the use of the
NodeCreateRule class, which will allow a subset of the xmlrpc stream -
in the form of a DOM Node - to be passed into a user-defined method for subsequent
(possibly) recursive parsing. However, I discovered that the NodeCreateRule suppresses
(as a side effect) the triggering of pattern matching rules under the XML element
whose match triggered the NodeCreateRule in the first place. This side-effect
resulted in an object not getting popped from the Digester stack, which results
in an Exception being thrown by the Digester later on (Digester's stack now being
out of sync because a rule that would have popped an entry to the stack was
no longer being triggered when an 'n-level structure' was encountered.

i hope this is not too vague. i can provide an example xmlrpc msg and the Java source
I am using if anyone cares to help out with this.

In brief, I guess I am asking: given what i am trying to do and the structure of the
incoming xmlrpc stream, can I use Digester to properly parse this arbitrarily
recursive stream? is there some other xmlrpc parsing package that I should use
instead?

Many thanks for any help

- rich

-- 
rich coco
racoco@starbak.com
781.736.1200  x165
Starbak Inc.
29 Sawyer Rd.
One University Office Park
Waltham, MA 02453


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message