0
By manipulating a xml
return of a service, I do the following manipulation in the file:
return xmlServico.replaceAll("job.coincidencia.vo.", "").replaceAll("RNSCoincidenciasMultiRamo_-", "").replaceAll("Coincidencia", "").replaceAll("<>", "").replaceAll("</>", "");
However, such replaces
generated empty lines in the middle of the file and, although it seems simple, I am not able to remove these empty lines. I have tried using .replaceAll(" ", "");
but the empty lines are still there and it still takes away all the formatting from the xml
.
Have you considered replacing all ' n' that are on a line that has no xml tags?
– Adriano Gomes
I find it simpler to use a specific lib to manipulate XML - in Java there are several. Making string replacements is very error prone, there is corner cases too much to be treated, something a lib can handle much better.
– hkotsubo
@Adrianogomes did this but was taking out all the xml formatting but in the end I ended up doing more or less that same. Thanks for the help, friend.
– eugenissimo
@hkotsubo Thanks for your attention, friend. I ended up solving otherwise.
– eugenissimo