Re: XML reformatting on load
It's probably because you are using the Microsoft XML Libary, it is probably automatically determining the line formatting.
If you don't want it split up then just use a regular text reader...
Re: XML reformatting on load
don't confuse the data with the display output... as long as the object is being loaded with the data correctly, does it really matter what the output format looks like?
Besides, I happened to notice that there is a space or something at the same points where your printed xml breaks and indents... which makes me wonder if your xml really is the way you think it is...
-tg
Re: XML reformatting on load
Actually, the XML ouput does matter since I will be updating and saving the XML back to the original XML file I am reading it from. The samples of XML I provided were both from the Immediate window in the VBE as a result of a Debug.Print.
I have been given XML files that I need to update and then send back to the person that sent them to me. I'm under strict instructions that I am to update one tag and nothing else. When I sent these back to the client, they caused issues because of the change in formatting.
Quote:
Besides, I happened to notice that there is a space or something at the same points where your printed xml breaks and indents... which makes me wonder if your xml really is the way you think it is...
That is what I am having the biggest problem with, techgnome. Some of these XML files I receive were created from an old in-house XML generator and some seem to somehow have these empty tags in them (<i> </i>, etc). Unfortunately, I am not allowed to remove them.
So my question still stands: How do I keep DOMDocument60's Load event from reformatting my XML?
Re: XML reformatting on load
I got around my problem by using FileSystemObject and string functions to update the data I needed to update (I didnt really like doing this, but I had to do what I had to do). It is odd that the DOMDocument's Load created the hard line breaks where it did. I am still not sure why it happened and what I needed to do to stop it from happening. My problem is resolved, but I am going to leave this open for about a week to see if anyone may have ideas of what may have been causing this to happen and/or suggestions of how to stop it from happening in the future.