@Override
	protected Object doExec(Element element, Object scope, String propertyPath, Object... arguments) throws IOException, TemplateException {
		if (!propertyPath.equals(".") && ConverterRegistry.hasType(scope.getClass())) {
			throw new TemplateException("Operand is property path but scope is not an object.");
		}
		Element keyTemplate = element.getFirstChild();
		if (keyTemplate == null) {
			throw new TemplateException("Invalid map element |%s|. Missing key template.", element);
		}
		Element valueTemplate = keyTemplate.getNextSibling();
		if (valueTemplate == null) {
			throw new TemplateException("Invalid map element |%s|. Missing value template.", element);
		}
		Map<?, ?> map = content.getMap(scope, propertyPath);
		for (Object key : map.keySet()) {
			serializer.writeItem(keyTemplate, key);
			serializer.writeItem(valueTemplate, map.get(key));
		}
		return null;
	}
@ Override protected Object doExec ( Element element , Object scope , String propertyPath , Object ... arguments ) throws IOException , TemplateException { if ( ! propertyPath . equals ( "." ) && ConverterRegistry . hasType ( scope . getClass ( ) ) ) { throw new TemplateException ( "Operand is property path but scope is not an object." ) ; } Element keyTemplate = element . getFirstChild ( ) ; if ( keyTemplate == null ) { throw new TemplateException ( "Invalid map element |%s|. Missing key template." , element ) ; } Element valueTemplate = keyTemplate . getNextSibling ( ) ; if ( valueTemplate == null ) { throw new TemplateException ( "Invalid map element |%s|. Missing value template." , element ) ; } Map < ? , ? > map = content . getMap ( scope , propertyPath ) ; for ( Object key : map . keySet ( ) ) { serializer . writeItem ( keyTemplate , key ) ; serializer . writeItem ( valueTemplate , map . get ( key ) ) ; } return null ; }
Execute MAP operator. Extract content map using given property path and serialize every map entry using first two child
elements as key/value templates.

@param element context element,
@param scope scope object,
@param propertyPath property path,
@param arguments optional arguments, not used.
@return always returns null to signal full processing.
@throws IOException if underlying writer fails to write.
@throws TemplateException if element has not at least two children or content map is undefined.