I would like to know how to use the character "
"
(LINE FEED) to separate some information in an attribute. Look the example below:
<element attrinfo="info1=109
info2=108
info3=107" />
I use SetAttribute()
to set the attribute's text, but when the I save the XML, the information in attrinfo
looks like that:
<element attrinfo="info1=109&#xA;info2=108&#xA;info3=107" />
The "&"
is a special character, so the XML substitutes it by "&"
How can I solve this? I saw something about use Entity Reference but I don't understand how to use it.
Here is my code using \n:
ls_DadosAdicionais = "volume=1800;peso=78;altura=157"
ll_pos = POS( ls_DadosAdicionais, ";" )
DO
ls_DadosAdicionais = REPLACE( ls_DadosAdicionais, ll_pos, 1, '~n' )
ll_pos = POS( ls_DadosAdicionais, ";", ll_pos + 1 )
LOOP WHILE ll_pos > 0
lo_exm = io_xml.createElement( "exame")
lo_exm.SetAttribute( "dados_adicionais", ls_DadosAdicionais )