Hola Vikranth y Karsten,
Muchas gracias.
Terminamos con algo como:
REPORT zcix013.
DATA offset TYPE i.
DATA length TYPE i.
DATA val TYPE i.
DATA tag TYPE string.
DATA results TYPE match_result_tab.
DATA result TYPE match_result.
DATA wad_xml TYPE string.
DATA formatted_text_xml TYPE string.
DATA regexstr TYPE string VALUE '&#\d{2,3};'.
PARAMETERS: p_xml TYPE string.
* CL_ABAP_MATCHER
" Traducción de etiquetas WAD wad_xml a etiquetas XHTMLB
" Aquí no se realizarán comprobaciones de la sintaxis de WAD, solo se comprobará la sintaxis de FormattedTextView a continuación
wad_xml = p_xml.
* DSVAS_TEXTE_CONVERT_ITF2ASCII
offset = 0.
FIND ALL OCCURRENCES OF REGEX regexstr IN wad_xml RESULTS results.
LOOP AT results INTO result.
length = result-offset - offset.
CONCATENATE formatted_text_xml wad_xml+offset(length) INTO formatted_text_xml.
offset = result-offset + 2.
length = result-length - 3.
tag = wad_xml+offset(length).
ASSERT tag IS NOT INITIAL.
val = tag.
TRY.
tag = cl_abap_conv_in_ce=>uccpi( val ).
CATCH cx_root.
CONCATENATE '&#' tag ';' INTO tag.
ENDTRY.
CONCATEN