There's an issue that's been vexing me. I first encountered it when I found that I couldn't remove cover art from a realm export, so I figured I would export the realm, remove it from the XML code, then import that into a new realm.
Except that when importing the edited XML, I got an error. I didn't understand why I got an error, because it was just XML. It should have been fine. I emailed support, but I haven't heard back. Still, it's not a functional bug (it doesn't affect the way the program runs), and Rob put cover art removal on the list for future updates, so I let it go.
Here I am a few weeks later, though, wanting to do other things with XML, and trying out some manual edits to confirm how certain things work before I start scripting. And again, all I'm editing is content that's already there. I enter some content, export the realm, edit the content, reimport it, and I get an error. I remove one letter in one word, and I get an error.
At a high level (not at a low level), I finally figured out why my edits are resulting in errors when I reimport.
I am using UltraEdit as my XML viewer and editor. When I load a Realm Works export, it's just one, big block of text. (See the attached "raw XML.png" screenshot.)
Obviously, this is difficult to parse with human eyes and a human brain. UltraEdit has a feature to reformat XML so it's organized, hierarchical, and easy to read. (See the attached "formatted XML.png" file.)
The two attached screenshots are of the exact, same file. The raw one as Realm Works exported it, and the formatted one as UltraEdit reformatted it.
When I've loaded any XML file into UltraEdit, the first thing I've done is reformat it, because I didn't think it would matter. I thought, as long as all the XML tags are intact, it shouldn't matter whether the file is one, big block of text or not. So I would edit the formatted version, save that, and try to import that version.
But apparently, it does make a difference. When I edit the raw file with the exact same edits I apply to the formatted file, the edited raw file imports with no issues.
Now, at a low level, what I don't know is:
EDIT: Ugh, I can't attach the files.
Except that when importing the edited XML, I got an error. I didn't understand why I got an error, because it was just XML. It should have been fine. I emailed support, but I haven't heard back. Still, it's not a functional bug (it doesn't affect the way the program runs), and Rob put cover art removal on the list for future updates, so I let it go.
Here I am a few weeks later, though, wanting to do other things with XML, and trying out some manual edits to confirm how certain things work before I start scripting. And again, all I'm editing is content that's already there. I enter some content, export the realm, edit the content, reimport it, and I get an error. I remove one letter in one word, and I get an error.
At a high level (not at a low level), I finally figured out why my edits are resulting in errors when I reimport.
I am using UltraEdit as my XML viewer and editor. When I load a Realm Works export, it's just one, big block of text. (See the attached "raw XML.png" screenshot.)
Obviously, this is difficult to parse with human eyes and a human brain. UltraEdit has a feature to reformat XML so it's organized, hierarchical, and easy to read. (See the attached "formatted XML.png" file.)
The two attached screenshots are of the exact, same file. The raw one as Realm Works exported it, and the formatted one as UltraEdit reformatted it.
When I've loaded any XML file into UltraEdit, the first thing I've done is reformat it, because I didn't think it would matter. I thought, as long as all the XML tags are intact, it shouldn't matter whether the file is one, big block of text or not. So I would edit the formatted version, save that, and try to import that version.
But apparently, it does make a difference. When I edit the raw file with the exact same edits I apply to the formatted file, the edited raw file imports with no issues.
Now, at a low level, what I don't know is:
- If my assumptions about XML are wrong (that being that as long as the tags are in place, it shouldn't matter what the file looks like.)
- If UltraEdit is doing something funky when it reformats the file.
- If Realm Works is doing something funky by not recognizing that even if the file looks different, the tags are still intact.
EDIT: Ugh, I can't attach the files.