commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Cornell" <michael.corn...@estafet.com>
Subject [digester] dynamic xml parser
Date Wed, 13 Oct 2004 09:21:15 GMT

Hi,

Just trying to use digester to parse a bit of xml looking something like:

<root>
    <object ID="">
        <attr_name> object1</attr_name>
        <attr_value>Control1</attr_value>
    </object>
    <object ID="12345">
        <attr_name> object2</attr_name>
    </object>
</root>

I will always know the names of these innermost elements (attr_name,
attr_value here) but the number of innermost columns can change and have
different names.  Also as above I can never be certain that all the columns
exist, but they will always be in the same order.

My question is this:
Can I use digester to parse this piece of  generic xml by passing it an
array of String with the innermost column names and return me an object with
these values (eg a hashtable key:col, val:value)
Eg MyDigesterClass.parse(xmlString, String [] innerColNames)

Could someone point me in the right direction??

Thanks
Michael


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.775 / Virus Database: 522 - Release Date: 08/10/2004

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message