Issue with Creating an XML Document - Help/Advise Needed

sprosser

New Member
Licensed User
Longtime User
Hello All

This is my first posting to this forum, I hope someone can help, or tell me what I am doing stupidly.

Lib: XML(v2.6)

Background:
I am trying to build an xml message/docment, that will be sent with a HTTP request/response to a transactional website, for further processing.

Issue:
1. I have added an XmlDocument object from the above lib.
2. Initialised with .New1
3. This process creates, my new object and as per documention adds a standard 'processinginstruction'. This is my issue:

What seems to be added is: <?xml version="1.0" encoding="utf-8"?>
This should be: <?xml version="1.0" encoding="utf-8"?>

As can be seen there are extra char's at the front of the pi tag

The char's are not visible in notepad/textpad or even when opened in a browser, and the 'XmlDocumentDemo.sbp' also ignores them, but they can be seen in ultraedit.

4. My issue is they should not be there (or: is there a reason, then please explain), and the transaction server returns a HTTP 406 error, when it receives the document sent to it.
406: content is not allowed in prolog (line1, column)
5. If I add an extra pi tag my self to the docment this displays/works correctly, but it is not possible to remove the <?xml ?> pi tag as it is not reconised, and if you do a childcount on the #document, it will not include it.
So, I cannot just add a corrected pi tag and remove the incorrect on.

This error, can also be seen, when running the sample: 'XmlReadWrriteDemo.sbp' in the XML2.6 zip and checking the output file generated.

If you create a clean/working xml doc and load it into a xmldocument object I get the same issue. so it does seem to me that its the .New1 function doing this.

Action:
:sign0085:

1. Does anybody have this issue, or more importantly a workaround or fix.
2. Or could someone tell me if it something that I am doing (demo has the same issue, so not sure if it is me being stupid, but you never know)

Thank You
Simon
 

specci48

Well-Known Member
Licensed User
Longtime User
Hello Simon,

an explanation for the "extra chars" can be found here - see section "Byte order mark".



specci48
 
Top