I have an xml as shown in the image below.
<erros>
<error id="30" message="VENDEDOR NAO EXISTE" />
<error id="31" message="SEM LOTERIAS" />
<error id="37" message="TERMINAL INVALIDO"/>
<error id="41" message="ERRO AO GRAVAR POULE"/>
<error id="42" message="LOTERIA COM ERRO"/>
<error id="43" message="JOGO COM ERRO"/>
<error id="44" message="NUMERO PROIBIDO"/>
<error id="45" message="VALE COM ERRO"/>
<error id="46" message="LOTERIA INVALIDA"/>
<error id="47" message="DATA INVALIDA"/>
<error id="48" message="NUMERO COTADO"/>
<error id="49" message="LIMITE EXCEDIDO"/>
<error id="51" message="POULE INEXISTENTE"/>
<error id="61" message="TERMINAL INVALIDO"/>
<error id="62" message="COBRADOR INVALIDO"/>
<error id="71" message="RESULTADO NAO EXISTE"/>
<error id="81" message="SEM PREMIACAO"/>
<error id="82" message="PULE JA PAGA"/>
<error id="83" message="RESUMO NAO EXISTE"/>
</erros>
Then, I would like to add a switch, comparing a variable of the whole type, with the id inside the xml, and if it has the id equal to one declared in the tags, print the message on the screen. And if not, print on the SUCCESS screen. Thk's for any help.
EXAMPLE
int i = Integer.parseInt(verifyMsg);
switch (i) {
case 1:
// Send message id 1
break;
case 2:
// Send message id 2
break;
}