1.

Solve : How to quickly edit a XML file.?

Answer»

I have XML backup fills of  my WORDPRESS blog. It gos back years. So when I try to load it into an empty WordPress install, I get an error message.  It said the file was too long. It is. It is about 4 MB, the limit is 2 MB.
So, my question is -- How do you cut the number on entries in an XML . I tried to delete what I thought were entries, the but editor did not work the way I though it wold. The file is still large.
Yeah, I am dummy on XML. I have no idea of how it works.
Any help? Pleas?   
I would open it in an text editor such as notepad and then carefully remove only what is not necessary. Then save the file to a different FOLDER as to not overwrite your original file. Or start off with a copy of the original file in a safe location so you dont overwrite the master 4MB file. Im kind of curious as to how it grew to an unsupported size. But I have seen other instances of databases and files exceeding their supported size before. Sometimes it can be prevented I guess I am saying. XML files are basically text files with text but saved in XML format. Looking at them if you have looked at HTML before you might see similarities between them to make it more straight FORWARD to follow tags in them and whats necessary and what is not necessary that can be removed. For 4MB you have a HUGE XML file as for it takes a lot of text to get to that size. If its 40 pages long you need to removed about 20 pages of it to fall within the 2MB.

 Hope this info helps.XML editors tend to complicate things when ti comes to editing, and are more useful (IMO) to find and navigate the structure of an XML file.
In this case, you should be fine just using a text editor. There is a "" tag, and inside that tag you can find "" tags. You should be able to delete any tag entries you want.

Another APPROACH could be to make a copy of the file that deletes everything and leaves a empty "channel" tag, then you can cut half the tags from the other file into it, splitting your backup file practically in half.Thank you both. Yes, I made backups and search all my drives for any other instances of the files. This problem, I found, comes with the WordPress exporter. It does not warn thou that the output file will become too large. You have the option to save posts between some dates. Doing that, one would not get moister size files. I was saving everything I ever wrote, along with all the spam I did not remove.

{Note: It is the importer that puts a limit of 2 MB on the XML  file.}

Wrath Notepad i twas much too hard.  So I got a simple XML editor from Microsoft.
Yes, BC, thunks for the tip about item.
 In the database item is a post will all of it's attributes. Kinda looks like the registry, but it is not.  After a couple of tests offline, I finally exported and imported the right amount of data to re populate my blog.

This happened because I did not pay my web host account on time. So they just wiped out my whole site. It would not matter If I was making backups more often.

Thank you both for your help.
From now on I will backup more often and make smaller files.
And I hope I never have to edit an XML ever again!   





Discussion

No Comment Found