Displaying # (hash) character in NAV

jordi79jordi79 Member Posts: 274
Hi,
I need to export some texts in XML format. As we all know special characters must be formatted accordingly before I can be displayed properly in XML. For example...

<XMLTag>This isn't correct</XMLTag>

must be in the form below for be displayed correctly in XML

<XMLTag>This isn't correct</XMLTag>

The problem with NAV is that, whenever it sees a # sign, it assumes that it is a dialog tag for progress bars (I think this is what NAV is doing...), and in when exported in text file, it became:

<XMLTag>This isn& 39;t correct</XMLTag>

How do you print or display the # character in NAV? I have tried creating a char variable and assigning it to 35 (which is the ASCII code for Hash) but this does not work. Anyone have any ideas?

Comments

  • jwilderjwilder Member Posts: 263
    Create a text variable and give it a value of #. Then you can use the text variable in your code. Maybe that will work.

    Are you using the xml dom to create your xml file or are you doing it manually?
  • jordi79jordi79 Member Posts: 274
    hi,
    Just tried that. It does not work too.


    str2 := '#';
    MESSAGE('&' + str2 + '39;');

    Microsoft Dynamics NAV
    & ;
    OK
  • MBergerMBerger Member Posts: 413
    Have you tried the normal HTML entity for the apostrophe : ' ?
  • jordi79jordi79 Member Posts: 274
    MBerger wrote:
    Have you tried the normal HTML entity for the apostrophe : ' ?

    Brilliant solution. It works. I did not know special chars can be represented in 2 forms. the numeric form and code form. numeric form being ' and code form being '

    Anyway, problem solved for this. But really... in the case that you really did need to print the character #, how do you do it in NAV? I wonder... :-k
Sign In or Register to comment.