After trying to parse an input XML document and produce an output XML document I keep getting an output file that contains only the string "ÿþ>". The output document is created without any errors, and the DOM.parseError displays an error number of 0 (no error I imagine). What is this string and where does it come from?
Asked
Active
Viewed 823 times
-1
-
Please make your question more self-contained. It's hard to go through a bunch of previous questions just to find out what you're talking about. Add the minimum of code required to reproduce the issue. An XML document on its own does not produce an error. – Thomas Weller May 14 '14 at 21:40
-
@ThomasW. This is a bit late, but I've left only the heart of the question - it didn't actually need to reference any external links. – 114 Jan 07 '15 at 17:30
1 Answers
1
The three bytes you get is the Byte Order Mark (BOM). You can get rid of the BOM by saving the file in ANSI format as shown in the pre-previous answer to your question related on this topic.
If you can't save as ANSI because your XML contains characters which would get lost, then check how you opened the file. It seems you're reading the content from disk into a string and then load it as XML. Try loading it from disk directly into XML. The StackOverflow answer for VBA Output to file using UTF-16 might also be helpful.
BTW: If the macro you're talking about is
Set Entity = DOM.DocumentElement.getElementsByTagName("EntityId")(0)
then also check the casing: your XML uses entityId
but your macro uses EntityId
.

Community
- 1
- 1

Thomas Weller
- 55,411
- 20
- 125
- 222
-
Thanks for your reply. The file was encoded as ANSI by default, but this did not resolve the issue. I have also been careful to check cases. It's great to know there's a name for the characters I'm getting though. – 114 May 15 '14 at 14:50