/**
* 字符串转换成OMElement
*
* @param xmlStr
* 需转换的字符串
* @return
*/
public static OMElement str2OMElement(String xmlStr) {
OMElement xmlValue;
try {
xmlValue = new StAXOMBuilder(new ByteArrayInputStream(xmlStr
.getBytes("UTF-8"))).getDocumentElement();
return xmlValue;
} catch (Exception e) {
return null;
}
}
axis2_soap:字符串转换成OMElement
字符串转OMElement方法
最新推荐文章于 2021-02-23 21:21:08 发布
本文介绍了一种将字符串转换为OMElement对象的方法。通过使用StAXOMBuilder, 方法能够读取UTF-8编码的字符串,并将其构建为OMElement文档元素。此过程适用于处理XML格式的数据。
4334

被折叠的 条评论
为什么被折叠?



