Hi
I've created an XML Document in Navision using the DOM Object and some functions of code unit 6224. That's quite ok, the file looks ok in a viewer programm (internet explorer for example).
If viewed with a text editor, there are no line breaks in the file. This is a problem if the file later causes a parsing error (XMLParseError.line is useless and XMLParseError.src l would exceed 1024 characters).
As I understand, line breaks are not part of the xml specification, but become very handy for debugging reasons.
Any ideas?
Many thanks in advance
Thomas
0
Comments
we use this function to get most of the information:
and don't try to put srcText in the message when working with very big files
There is another problem with validation:
To validate a xmlDoc against its schema, I often use a function similar to function validatexmldocument in codeunit 99008518. This works sometimes ok, but sometimes only with xml4-objects and sometimes not at all (when it does not work an error occurs in the add-method of the schemacache -- so I have no chance to handle the error).
As far as I know, there are 3 concepts to test against a schema: noNameSpaceSchemaLocation, schemaLocation and schema cache. I guess schema cache is convenient, because it does not depend on a given filename in the xmlDoc.
Do you have a "bullet proof" method to validate against its schema?
Many thanks in advance
Thomas