Your XML files have tabs instead of spaces, and you want to replace the tabs in Visual Studio 2008. Here we find out what Microsoft's developers have to say, and consider the options.
If you have a project that parses thousands of XML files per day, you want to optimize the XML. Microsoft, in developing the Open XML (.docx, .xlsx) format, investigated XML performance with tag name length.
Microsoft developer. From Brian Jones on XML: "Let's imagine we have... 7 million elements and 10 million attributes. If on average each attribute and element is about 2 characters long, then you have 34 megabytes of data to parse. If instead though, the average length of an attribute and element were more like 10 characters, then you're talking about 170 megabytes."
Tab file sizes. In Brian's example, 'minifying' the XML saved a huge amount of disk space (almost 140 megabytes) and processor time (when compressing or sending). This is significant.
The term 'minifying' is applied to CSS and JavaScript on the web, but it also can work for XML. In Visual Studio, a tab character is usually equal to 4 spaces. So, we can save a lot of space by using tabs instead of spaces.
First steps. In Visual Studio Go to Tools > Options... This will bring up the Options window. In the left, there are a bunch of arrows and labels. Click on Text Editor, and then go to XML.
Indent size. This is where you can save bytes. Choose 'Keep tabs' if it isn't already selected. This will decrease the size of XML files you edit.
Here we can change lines in Visual Studio to use tabs. This will reduce file size in your XML files on the selection. Go to Edit > Advanced. There are many useful options here.
To measure tab characters' effect on file size, I measured a sitemap XML file with spaces, and then with tabs. The results were somewhat surprising. The results show the size in bytes for the resulting XML file when formatted with spaces and when formatted with tabs.
=== Size in bytes for file types === XML file with spaces: 30967 bytes XML file with tabs: 25891 bytes [smaller]
Here we saw that changing tabs in Visual Studio XML files has a significant effect on file size. Use Tabify and Untabify wisely and always keep in mind the coding guidelines of your project.