Why rely on XML ?
Convert the document to a document with xmlNodeToDocument and then use a java service to convert it to a map. I have posted code from own webMethods tools
/**
* Extracts all strings found in the IData record and returns them in a map. Sub records are also scanned.
* Repeating key/value pairs overwrite previous pairs.
*
* @param record The IData record to convert to a map
* @return Map A map of all key/value pairs in the IData structure without those pairs indicated by excludeList
*/
public static Map<String, String> convertIDataStringsToMap(IData record)
{
return convertIDataStringsToMap(record, null);
}
/**
* Extracts all strings found in the IData record and returns them in a map. Sub records are also scanned.
* Repeating key/value pairs overwrite previous pairs.
*
* @param record The IData record to convert to a map
* @param excludeList The names of keys to ignore, ie don't put in map
* @return Map A map of all key/value pairs in the IData structure without those pairs indicated by excludeList
*/
public static Map<String, String> convertIDataStringsToMap(IData record, String[] excludeList)
{
if (record == null)
return null;
IDataCursor cursor = record.getCursor();
Map<String, String> stringMap = new HashMap<String, String>();
while (cursor.next())
{
String key = cursor.getKey();
Object value = cursor.getValue();
if (value instanceof String && (excludeList == null || !isStringInArray(excludeList, key)))
stringMap.put(key, (String) value);
else if (value instanceof IData)
stringMap.putAll(convertIDataStringsToMap((IData) value, excludeList));
}
cursor.destroy();
return stringMap;
}
Sorry for not getting back to you sooner, We are now trying really hard to make sure someone will respond more time to questions raised here
regards,
John.
#Flow-and-Java-services#webMethods#Integration-Server-and-ESB