Cannot view XML input using XSL style sheet

senthilsenthil Member Posts: 9
Hi,
I am trying to export a user defined table(created by myself) to a xml file by using XMLPort. I run the code from the codeunit. I used the following code.

TestFile.CREATE('D:\Navision\XMLFile\Import.xml');
TestFile.CREATEOUTSTREAM(TestStream);
XMLPORT.EXPORT(90109,TestStream);
TestFile.CLOSE;

The XML file has successfully created. But the problem is when i opened that XML file in IE it shows the following error

Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
A name was started with an invalid character. Error processing resource 'file:///D:/Navision/XMLFile/Import.xml'. Line 3, ...

But i opened the XML file in notepad all data of that table has been exported to the XML File successfully. But in XML FIle i could not seen all the rows. i seen the first row only. Y it has happened like this. And Y this error is coming
Regards,

Senthil

Comments

  • todrotodro Member Posts: 117
    senthil wrote:
    Hi,
    I am trying to export a user defined table(created by myself) to a xml file by using XMLPort. I run the code from the codeunit. I used the following code.

    TestFile.CREATE('D:\Navision\XMLFile\Import.xml');
    TestFile.CREATEOUTSTREAM(TestStream);
    XMLPORT.EXPORT(90109,TestStream);
    TestFile.CLOSE;

    The XML file has successfully created. But the problem is when i opened that XML file in IE it shows the following error

    Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
    A name was started with an invalid character. Error processing resource 'file:///D:/Navision/XMLFile/Import.xml'. Line 3, ...

    But i opened the XML file in notepad all data of that table has been exported to the XML File successfully. But in XML FIle i could not seen all the rows. i seen the first row only. Y it has happened like this. And Y this error is coming
    2 things:

    a.) notepad and wordpad are working different when it comes to the encoding

    b.) IE sometimes fails to display even well-formed XML files :(

    Notepad decodes e.g. a UTF-8 file and it looks "pretty", wordpad reads it as a raw format and it looks scrambled because of the special characters.

    Therefore, I suggest you'd use a program where you will be able to check the raw data and the decoded separately, e.g. if you use special characters and they are encoded with UTF-8 and you open the file in notpad, it seems to be OK. BUT you do not know, wthether is has been encoded in special encoding format as you will see the decoded result.

    Use either a hex editor or real XML editor like XMLSPY
    Torsten
    MCP+I, MCSE NT, Navision MCT (2004,2005)
Sign In or Register to comment.