Hi Guys,
I have not had much call to use XML, so my knowledge here is very light, most of the files I work with are Excel or CSV.
I have to export Sales Invoices, and "Navision 5.01" add a header line to the file, this causes it not to open in a browser, we want to remove the first line of the XML.
<?xml version="1.0" encoding="UTF-16" standalone="no" ?>
I have searched and found a couple of solutions from April 2011, none of which I could get to work, I used the last one in this post from Joe Mathis.
Remove heading on XMLport output?
I get the error, "Could not Invoke the member removeChild", then a message unknown error code returned, with no detail
Does anyone have a working example of this?
Regards
David
Analyst Developer with over 17 years Navision, Contract Status - Busy
Mobile: +44(0)7854 842801
Email:
david.cox@adeptris.com
Twitter:
https://twitter.com/Adeptris
Website:
http://www.adeptris.com
Answers
The xml file I have been exporting has to have an attribute "ns0:" and an external schema!
In the xml port I added a row:
On export this gave me a lines like:
I have to then remove the first line for it to import and open up in Internet Explorer, you would think it was easy but! ](*,)
I found this post on Dynamics User and adapted the code to remove just the first line.
Variables: This is what the code does.
Export the xml file open it in text mode find the file position at the end of the first line Close the file Open it in binary mode Create and read the file into a new file Truncate the new file close the files Delete the tempory file
Hpe this helps someone else \:D/
Mobile: +44(0)7854 842801
Email: david.cox@adeptris.com
Twitter: https://twitter.com/Adeptris
Website: http://www.adeptris.com