XMLElement - getIteratorOverAllChildren()

Returns an XMLElementIterator object that includes all sub elements for the XML element based on the specified parameter.

This method is available only in an Edge Encryption rule action script.

Table 1. Parameters
Name Type Description
None
Table 2. Returns
Type Description
XMLElementIterator An object that will iterate over elements in the XMLElement object.

This example is from the List Edit encryption rule.

function ListEditAction(request) {
	var xmlContent = request.postParams.sysparm_xml.getAsXmlContent();
	for (var xmlElementIter = xmlContent.getIterator('record_update'); xmlElementIter.hasNext(); ) {
		var xmlElement = xmlElementIter.next();
		var tableName = xmlElement.getAttributeValue('table');
		for (var xmlRecordIter = xmlElement.getIterator('record'); xmlRecordIter.hasNext(); ) {
			var xmlRecord = xmlRecordIter.next();
			for (var xmlFieldIter = xmlRecord.getIterator('field'); xmlFieldIter.hasNext(); ) {
				var xmlField = xmlFieldIter.next();
				var fieldName = xmlField.getAttributeValue('name');
				for (var childIter = xmlField.getIteratorOverAllChildren(); childIter.hasNext(); ) {
					var childElement = childIter.next();
					childElement.valueFor(tableName, fieldName);
				}
			}
		}
	}
}