You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by qi...@freddiemac.com on 2004/08/13 00:46:23 UTC

mapping data according to xml

Hi all 

I am getting a problem to map data to a bean's attribute encoded in an XML 
file like this:
.........
        <object> 
                <name>
                        com.somewhere.someproj.topbean
                </name>
                <object>
                        <name>
                                subbean
                        </name>
                        <object>
                                <name>
                                        StringAttribute
                                </name>
                        </object>
                </object>
        </object>
...........

Suppose I can obtain an instance of com.somewhere.someproj.topbean 
and I can parse this XML file and get his mapping from top down to the 
bottom. 

Is XMLBean the best way(tool) to make this happen:

String mydata=(String) 
com.somewhere.someproj.topbean.getSubBean.getStringAttribute()

Or is JAVA reflection a better way?


Thx