Thursday, February 13, 2014

Creating OMElement from a list of Array Elements

Creating an  OMElement  from an Array of elements , requires a custom xml root element, which will wrap all arguments.
Here is a sample code snippet to do that;

String[] csvArray = csvList.toArray(new String[csvList.size()]);
OMElement csvOMElement =  BeanUtil.getOMElement(qname, csvArray, null, false, null);

qname = new QName("csv"); // here user can  provide  prefered root element for his OMelement.

No comments:

Post a Comment