invalid characters in xmlport

asicsasics Member Posts: 5
Hi,

I'm running nav5.0 and use xmlports to create xml files.
I've managed to create an invalid xml file as the data contains invalid characters.
Is there a way to prevent NAV from sending this strange characters?
Please find below an example of what is created....

<Number>B900Y</Number>
<Location_in_Inventory>DCR</Location_in_Inventory>
<Description>滫ÊË¿ó¡áÙ «íÌóÕ ñ½Ù ó«½Ñí«½á </Description>
<Additional_Description/>

Comments

  • ufukufuk Member Posts: 514
    Why are there invalid characters in your file? Isn't it possible to correct these corrupted characters? Otherwise, you can use built-in string functions to format your texts, automations or your own dll.

    Using DELCHR you can exclude the chars out of your predefined set: (But this method can cause performance issues and it only allows usage of the chars that are defined in your set. )
    ValidChars := 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; 
    "My Field" := DELCHR("My Field",'=',DELCHR("My Field",'=',ValidChars));
    
    You can also write a dll (using regular expressions etc ) and call it via automation. (or you can directly call regular expression via automation and use its methods). These methods are more stable but can cause register issues.
    Ufuk Asci
    Pargesoft
Sign In or Register to comment.