• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Interesting XML quirk.

EightBitz

Well-known member
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:
  1. 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.)
  2. If UltraEdit is doing something funky when it reformats the file.
  3. 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.
 
OK, here's an example of the difference:

Raw:
Code:
<?xml version="1.0" encoding="utf-8"?><export format_version="3" game_system_id="4" source_scope_uuid="02B3227B-91C6-5D3A-00D0-6A93C30F6BA9" owner_uuid="4FC72A7B-91C6-5D3A-00D0-6A935C3C6BA9" export_date="2017-02-16T05:17:59Z" is_structure_only="false" xmlns="urn:lonewolfdevel.com:realm-works-export"><definition><details name="Pathfinder: Prime" import_tag_id="Tag_1" original_uuid="B5BA9BB6-5CEF-6A12-1E5C-6B93C30F6BA9" /><content_summary max_domain_count="141" max_category_count="93" topic_count="972" plot_count="0" /></definition><structure><domain_global domain_id="Domain_1" name="Adventure Area" global_uuid="741E2A7B-91C6-5D3A-00D0-6A935D3C6BA9"><tag_global tag_id="Tag_2" name="Area" global_uuid="FB1C2A7B-91C6-5D3A-00D0-6A935D3C6BA9" /><tag_global tag_id="Tag_3" name="Building" global_uuid="E000287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_4" name="Cavern" global_uuid="FC1C2A7B-91C6-5D3A-00D0-6A935D3C6BA9" /><tag_global tag_id="Tag_5" name="Complex" global_uuid="FD1C2A7B-91C6-5D3A-00D0-6A935D3C6BA9" /><tag_global tag_id="Tag_6" name="Dungeon" global_uuid="FE1C2A7B-91C6-5D3A-00D0-6A935D3C6BA9" /><tag_global tag_id="Tag_7" name="Fortress" global_uuid="FF1C2A7B-91C6-5D3A-00D0-6A935D3C6BA9" /><tag_global tag_id="Tag_8" name="Installation" global_uuid="001D2A7B-91C6-5D3A-00D0-6A935D3C6BA9" /><tag_global tag_id="Tag_9" name="Other" global_uuid="011D2A7B-91C6-5D3A-00D0-6A935D3C6BA9" /><tag_global tag_id="Tag_10" name="Ruin" global_uuid="021D2A7B-91C6-5D3A-00D0-6A935D3C6BA9" /><tag_global tag_id="Tag_11" name="Temple" global_uuid="031D2A7B-91C6-5D3A-00D0-6A935D3C6BA9" /></domain_global><domain_global domain_id="Domain_2" name="Affliction Type" global_uuid="F501287B-91C6-5D3A-00D0-6A935C3C6BA9"><tag_global tag_id="Tag_12" name="Curse" global_uuid="B402287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_13" name="Disease" global_uuid="C302287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_14" name="Insanity" global_uuid="3403287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_15" name="Poison" global_uuid="BD03287B-91C6-5D3A-00D0-6A935C3C6BA9" /></domain_global><domain_global domain_id="Domain_3" name="Age" global_uuid="751E2A7B-91C6-5D3A-00D0-6A935D3C6BA9"><tag_global tag_id="Tag_16" name="Child" global_uuid="051D2A7B-91C6-5D3A-00D0-6A935D3C6BA9" /><tag_global tag_id="Tag_17" name="Youth" global_uuid="071D2A7B-91C6-5D3A-00D0-6A935D3C6BA9" /><tag_global tag_id="Tag_18" name="Adult" global_uuid="041D2A7B-91C6-5D3A-00D0-6A935D3C6BA9" /><tag_global tag_id="Tag_19" name="Elder" global_uuid="061D2A7B-91C6-5D3A-00D0-6A935D3C6BA9" /></domain_global><domain_global domain_id="Domain_4" name="Alignment" global_uuid="F601287B-91C6-5D3A-00D0-6A935C3C6BA9"><tag_global tag_id="Tag_20" name="Chaotic Evil" global_uuid="6F02287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_21" name="Chaotic Good" global_uuid="7002287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_22" name="Chaotic Neutral" global_uuid="7102287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_23" name="Lawful Evil" global_uuid="4603287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_24" name="Lawful Good" global_uuid="4703287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_25" name="Lawful Neutral" global_uuid="4803287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_26" name="Neutral" global_uuid="8403287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_27" name="Neutral Evil" global_uuid="8503287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_28" name="Neutral Good" global_uuid="8603287B-91C6-5D3A-00D0-6A935C3C6BA9" /></domain_global><domain_global domain_id="Domain_5" name="Appearance Trait" global_uuid="761E2A7B-91C6-5D3A-00D0-6A935D3C6BA9"><tag_global tag_id="Tag_29" name="Beautiful" global_uuid="081D2A7B-91C6-5D3A-00D0-6A935D3C6BA9" /><tag_global tag_id="Tag_30" name="Diminutive" global_uuid="091D2A7B-91C6-5D3A-00D0-6A935D3C6BA9" /><tag_global tag_id="Tag_31" name="Disheveled" global_uuid="0A1D2A7B-91C6-5D3A-00D0-6A935D3C6BA9" /><tag_global tag_id="Tag_32" name="Filthy" global_uuid="0B1D2A7B-91C6-5D3A-00D0-6A935D3C6BA9" /><tag_global tag_id="Tag_33" name="Flabby" global_uuid="0C1D2A7B-91C6-5D3A-00D0-6A935D3C6BA9" /><tag_global tag_id="Tag_34" name="Hulking" global_uuid="0D1D2A7B-91C6-5D3A-00D0-6A935D3C6BA9" /><tag_global tag_id="Tag_35" name="Muscular" global_uuid="0E1D2A7B-91C6-5D3A-00D0-6A935D3C6BA9" /><tag_global tag_id="Tag_36" name="Ornate" global_uuid="0F1D2A7B-91C6-5D3A-00D0-6A935D3C6BA9" /><tag_global tag_id="Tag_37" name="Pristine" global_uuid="101D2A7B-91C6-5D3A-00D0-6A935D3C6BA9" /><tag_global tag_id="Tag_38" name="Slender" global_uuid="111D2A7B-91C6-5D3A-00D0-6A935D3C6BA9" /><tag_global tag_id="Tag_39" name="Stylish" global_uuid="65AF297B-91C6-5D3A-00D0-6A935D3C6BA9" /><tag_global tag_id="Tag_40" name="Tasteless" global_uuid="121D2A7B-91C6-5D3A-00D0-6A935D3C6BA9" /><tag_global tag_id="Tag_41" name="Towering" global_uuid="131D2A7B-91C6-5D3A-00D0-6A935D3C6BA9" /><tag_global tag_id="Tag_42" name="Ugly" global_uuid="75AF297B-91C6-5D3A-00D0-6A935D3C6BA9" /><tag_global tag_id="Tag_43" name="Unadorned" global_uuid="141D2A7B-91C6-5D3A-00D0-6A935D3C6BA9" /></domain_global><domain_global domain_id="Domain_6" name="Archetype" global_uuid="771E2A7B-91C6-5D3A-00D0-6A935D3C6BA9" /><domain_global domain_id="Domain_7" name="Archetype/Domain/Etc." global_uuid="F701287B-91C6-5D3A-00D0-6A935C3C6BA9"><tag_global tag_id="Tag_44" name="Arcane School (Elemental)" global_uuid="4302287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_45" name="Arcane School (Focused)" global_uuid="4402287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_46" name="Arcane School (Standard)" global_uuid="4502287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_47" name="Archetype" global_uuid="4702287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_48" name="Cleric Domain" global_uuid="8002287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_49" name="Cleric Subdomain" global_uuid="8102287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_50" name="Inquisition" global_uuid="2B03287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_51" name="Mythic Path" global_uuid="7E03287B-91C6-5D3A-00D0-6A935C3C6BA9" /></domain_global><domain_global domain_id="Domain_8" name="Armor Type" global_uuid="F801287B-91C6-5D3A-00D0-6A935C3C6BA9"><tag_global tag_id="Tag_52" name="Light Armor" global_uuid="4C03287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_53" name="Medium Armor" global_uuid="6D03287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_54" name="Heavy Armor" global_uuid="1C03287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_55" name="Shields" global_uuid="0204287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_56" name="Extras" global_uuid="EE02287B-91C6-5D3A-00D0-6A935C3C6BA9" /></domain_global><domain_global domain_id="Domain_9" name="Career" global_uuid="781E2A7B-91C6-5D3A-00D0-6A935D3C6BA9" /><domain_global domain_id="Domain_10" name="Celestial Region" global_uuid="48AE297B-91C6-5D3A-00D0-6A935D3C6BA9"><tag_global tag_id="Tag_57" name="Asteroid Field" global_uuid="F3AF297B-91C6-5D3A-00D0-6A935D3C6BA9" /><tag_global tag_id="Tag_58" name="Black Hole" global_uuid="6B082A7B-91C6-5D3A-00D0-6A935D3C6BA9" /><tag_global tag_id="Tag_59" name="Galaxy" global_uuid="EFAF297B-91C6-5D3A-00D0-6A935D3C6BA9" /><tag_global tag_id="Tag_60" name="Nebula" global_uuid="F4AF297B-91C6-5D3A-00D0-6A935D3C6BA9" /><tag_global tag_id="Tag_61" name="Other" global_uuid="F6AF297B-91C6-5D3A-00D0-6A935D3C6BA9" /><tag_global tag_id="Tag_62" name="Quasar" global_uuid="6C082A7B-91C6-5D3A-00D0-6A935D3C6BA9" /><tag_global tag_id="Tag_63" name="Star System" global_uuid="F2AF297B-91C6-5D3A-00D0-6A935D3C6BA9" /><tag_global tag_id="Tag_64" name="Travel Route" global_uuid="F5AF297B-91C6-5D3A-00D0-6A935D3C6BA9" /><tag_global tag_id="Tag_65" name="Void" global_uuid="EBAF297B-91C6-5D3A-00D0-6A935D3C6BA9" /></domain_global><domain_global domain_id="Domain_11" name="Challenge Rating" global_uuid="F901287B-91C6-5D3A-00D0-6A935C3C6BA9"><tag_global tag_id="Tag_66" name="CR 1/8" global_uuid="9802287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_67" name="CR 1/6" global_uuid="9702287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_68" name="CR 1/4" global_uuid="9602287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_69" name="CR 1/3" global_uuid="9502287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_70" name="CR 1/2" global_uuid="9402287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_71" name="CR 1" global_uuid="9302287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_72" name="CR 2" global_uuid="A302287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_73" name="CR 3" global_uuid="AA02287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_74" name="CR 4" global_uuid="AB02287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_75" name="CR 5" global_uuid="AC02287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_76" name="CR 6" global_uuid="AD02287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_77" name="CR 7" global_uuid="AE02287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_78" name="CR 8" global_uuid="AF02287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_79" name="CR 9" global_uuid="B002287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_80" name="CR 10" global_uuid="9902287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_81" name="CR 11" global_uuid="9A02287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_82" name="CR 12" global_uuid="9B02287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_83" name="CR 13" global_uuid="9C02287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_84" name="CR 14" global_uuid="9D02287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_85" name="CR 15" global_uuid="9E02287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_86" name="CR 16" global_uuid="9F02287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_87" name="CR 17" global_uuid="A002287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_88" name="CR 18" global_uuid="A102287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_89" name="CR 19" global_uuid="A202287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_90" name="CR 20" global_uuid="A402287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_91" name="CR 21" global_uuid="A502287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_92" name="CR 22" global_uuid="A602287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_93" name="CR 23" global_uuid="A702287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_94" name="CR 24" global_uuid="A802287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_95" name="CR 25+" global_uuid="A902287B-91C6-5D3A-00D0-6A935C3C6BA9" /></domain_global><domain_global domain_id="Domain_12" name="Character Condition" global_uuid="791E2A7B-91C6-5D3A-00D0-6A935D3C6BA9"><tag_global tag_id="Tag_96" name="Dead" global_uuid="151D2A7B-91C6-5D3A-00D0-6A935D3C6BA9" /><tag_global tag_id="Tag_97" name="Dying" global_uuid="161D2A7B-91C6-5D3A-00D0-6A935D3C6BA9" /><tag_global tag_id="Tag_98" name="Injured" global_uuid="171D2A7B-91C6-5D3A-00D0-6A935D3C6BA9" /><tag_global tag_id="Tag_99" name="Missing" global_uuid="181D2A7B-91C6-5D3A-00D0-6A935D3C6BA9" /><tag_global tag_id="Tag_100" name="Presumed Dead" global_uuid="191D2A7B-91C6-5D3A-00D0-6A935D3C6BA9" /><tag_global tag_id="Tag_101" name="Sick" global_uuid="1A1D2A7B-91C6-5D3A-00D0-6A935D3C6BA9" /><tag_global tag_id="Tag_102" name="Undead" global_uuid="1B1D2A7B-91C6-5D3A-00D0-6A935D3C6BA9" /></domain_global><domain_global domain_id="Domain_13" name="Character Role" global_uuid="40AE297B-91C6-5D3A-00D0-6A935D3C6BA9"><tag_global tag_id="Tag_103" name="Adversary" global_uuid="B1AF297B-91C6-5D3A-00D0-6A935D3C6BA9" /><tag_global tag_id="Tag_104" name="Color" global_uuid="B5AF297B-91C6-5D3A-00D0-6A935D3C6BA9" /><tag_global tag_id="Tag_105" name="Friend" global_uuid="B0AF297B-91C6-5D3A-00D0-6A935D3C6BA9" /><tag_global tag_id="Tag_106" name="Main Character" global_uuid="B3AF297B-91C6-5D3A-00D0-6A935D3C6BA9" /><tag_global tag_id="Tag_107" name="Neutral" global_uuid="B2AF297B-91C6-5D3A-00D0-6A935D3C6BA9" /><tag_global tag_id="Tag_108" name="Possible Rival" global_uuid="1C1D2A7B-91C6-5D3A-00D0-6A935D3C6BA9" /><tag_global tag_id="Tag_109" name="Possible Romance" global_uuid="1D1D2A7B-91C6-5D3A-00D0-6A935D3C6BA9" /><tag_global tag_id="Tag_110" name="Supporting Character" global_uuid="B4AF297B-91C6-5D3A-00D0-6A935D3C6BA9" /></domain_global><domain_global domain_id="Domain_14" name="Clan" global_uuid="7A1E2A7B-91C6-5D3A-00D0-6A935D3C6BA9" /><domain_global domain_id="Domain_15" name="Class" global_uuid="FA01287B-91C6-5D3A-00D0-6A935C3C6BA9"><tag_global tag_id="Tag_111" name="Adept" global_uuid="2402287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_112" name="Alchemist" global_uuid="2F02287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_113" name="Arcane Archer" global_uuid="4202287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_114" name="Arcane Trickster" global_uuid="4602287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_115" name="Arcanist" global_uuid="F207287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_116" name="Aristocrat" global_uuid="4902287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_117" name="Assassin" global_uuid="4E02287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_118" name="Barbarian" global_uuid="5302287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_119" name="Bard" global_uuid="5402287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_120" name="Battle Herald" global_uuid="5C02287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_121" name="Bloodrager" global_uuid="F307287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_122" name="Brawler" global_uuid="F407287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_123" name="Cavalier" global_uuid="6902287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_124" name="Cleric" global_uuid="7502287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_125" name="Commoner" global_uuid="8C02287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_126" name="Dragon Disciple" global_uuid="C702287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_127" name="Druid" global_uuid="CB02287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_128" name="Duelist" global_uuid="D602287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_129" name="Eldritch Knight" global_uuid="DD02287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_130" name="Expert" global_uuid="EC02287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_131" name="Fighter" global_uuid="F602287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_132" name="Gunslinger" global_uuid="1203287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_133" name="Holy Vindicator" global_uuid="1F03287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_134" name="Horizon Walker" global_uuid="2003287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_135" name="Hunter" global_uuid="F507287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_136" name="Inquisitor" global_uuid="2C03287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_137" name="Investigator" global_uuid="F607287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_138" name="Kineticist" global_uuid="3A03287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_139" name="Loremaster" global_uuid="5003287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_140" name="Magus" global_uuid="5903287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_141" name="Master Chymist" global_uuid="6203287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_142" name="Master Spy" global_uuid="6303287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_143" name="Medium" global_uuid="6603287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_144" name="Mesmerist" global_uuid="6F03287B-91C6-5D3A-00D0-6A935C3C6BA9" /><tag_global tag_id="Tag_145" name="Monk" global_uuid="7903287B-91C6-5D3A-00D0-6A935C3C6BA9" />

Formatted:
Code:
<?xml version="1.0" encoding="utf-8"?>
<export format_version="3" game_system_id="4" source_scope_uuid="02B3227B-91C6-5D3A-00D0-6A93C30F6BA9" owner_uuid="4FC72A7B-91C6-5D3A-00D0-6A935C3C6BA9" export_date="2017-02-16T05:17:59Z" is_structure_only="false" xmlns="urn:lonewolfdevel.com:realm-works-export">
	<definition>
		<details name="Pathfinder: Prime" import_tag_id="Tag_1" original_uuid="B5BA9BB6-5CEF-6A12-1E5C-6B93C30F6BA9" />
		<content_summary max_domain_count="141" max_category_count="93" topic_count="972" plot_count="0" />
	</definition>
	<structure>
		<domain_global domain_id="Domain_1" name="Adventure Area" global_uuid="741E2A7B-91C6-5D3A-00D0-6A935D3C6BA9">
			<tag_global tag_id="Tag_2" name="Area" global_uuid="FB1C2A7B-91C6-5D3A-00D0-6A935D3C6BA9" />
			<tag_global tag_id="Tag_3" name="Building" global_uuid="E000287B-91C6-5D3A-00D0-6A935C3C6BA9" />
			<tag_global tag_id="Tag_4" name="Cavern" global_uuid="FC1C2A7B-91C6-5D3A-00D0-6A935D3C6BA9" />
			<tag_global tag_id="Tag_5" name="Complex" global_uuid="FD1C2A7B-91C6-5D3A-00D0-6A935D3C6BA9" />
			<tag_global tag_id="Tag_6" name="Dungeon" global_uuid="FE1C2A7B-91C6-5D3A-00D0-6A935D3C6BA9" />
			<tag_global tag_id="Tag_7" name="Fortress" global_uuid="FF1C2A7B-91C6-5D3A-00D0-6A935D3C6BA9" />
			<tag_global tag_id="Tag_8" name="Installation" global_uuid="001D2A7B-91C6-5D3A-00D0-6A935D3C6BA9" />
			<tag_global tag_id="Tag_9" name="Other" global_uuid="011D2A7B-91C6-5D3A-00D0-6A935D3C6BA9" />
			<tag_global tag_id="Tag_10" name="Ruin" global_uuid="021D2A7B-91C6-5D3A-00D0-6A935D3C6BA9" />
			<tag_global tag_id="Tag_11" name="Temple" global_uuid="031D2A7B-91C6-5D3A-00D0-6A935D3C6BA9" />
		</domain_global>
 
The import parser is probably not throwing away whitespace properly like it should. The XML standard does say white space outside of tags should be ignored.
 
The import parser is probably not throwing away whitespace properly like it should. The XML standard does say white space outside of tags should be ignored.
Or worse editor added tab characters. Depending on the encoding you now have carriage return or line feed hex codes In the ASCII file being used to control end of line. It's very possible the RW XML parser is getting tripped up on any or all of those special characters.
 
Or worse editor added tab characters. Depending on the encoding you now have carriage return or line feed hex codes In the ASCII file being used to control end of line. It's very possible the RW XML parser is getting tripped up on any or all of those special characters.

I tried to see Notepad++ would cause the same issue, but I didn't see the same option to reformat.

What's the name of the other editor you use? The one that was recommended by LWD for the authoring kit?
 
I don't do anything with XML so I'm out of my depth in this discussion (not sure why I'm following along :D).

Could you open the formatted XML file in Word, and turn on the option to show the formatting characters (paragraph marks and such)? That might tell you what your formatting function is throwing into the mix.
 
I don't do anything with XML so I'm out of my depth in this discussion (not sure why I'm following along :D).

Could you open the formatted XML file in Word, and turn on the option to show the formatting characters (paragraph marks and such)? That might tell you what your formatting function is throwing into the mix.

As soon as you open it in Word, Word will muck it up.
 
I don't do anything with XML so I'm out of my depth in this discussion (not sure why I'm following along :D).

Could you open the formatted XML file in Word, and turn on the option to show the formatting characters (paragraph marks and such)? That might tell you what your formatting function is throwing into the mix.

That might actually be a good idea in concept, though. Just not with Word. UltraEdit might have an option to show invisible characters, and if it doesn't, I think NotePad++ does.
 
It is putting in paragraph marks and tab marks. But still, I thought those would be ignored. Not a big deal, though. Now that I know what the issue is, I can work around it. I'm not going to be do any heavy manual editing. Just some small things now and then for testing. I can get by.
 
Well ... as standard the XML should ignore anything not inside the tags, so not sure what's happening.
It could be that RW is running some checksum/Hash on the file to verify it, but then it would trip on any edit.
As to viewing the characters in Notepad++ [View] [Show Symbol] [Show all characters]
Reformatting XML in Notepad++ - install the XML plug in then do [Pretty print... ] various option there
 
Last edited:
Or worse editor added tab characters. Depending on the encoding you now have carriage return or line feed hex codes In the ASCII file being used to control end of line. It's very possible the RW XML parser is getting tripped up on any or all of those special characters.

In programmer parlance those are all whitespace. Any character code that doesn't actually show as a character on screen is whitespace.
 
maybe just try to replace certain special characters first to see if only tabs / carriage returns are disturbing? Maybe it makes a difference in which codepage you store the file windws/unix/utf ecetera...
 
maybe just try to replace certain special characters first to see if only tabs / carriage returns are disturbing? Maybe it makes a difference in which codepage you store the file windws/unix/utf ecetera...

I don't know regex ... at all, really. And it's really not that big of a deal ... yet. It may be later, but not right now.

Right now, my biggest issue is why PowerShell keeps reading an empty <contents /> element as a string instead of an XML element. I've tried various suggestions I've found online to do things a different way, but none have worked yet.
 
It has to be <contents/> Just as XML is supposed to ignore whitespace outside of tags it does not ignore it inside of tags.
 
I tried to see Notepad++ would cause the same issue, but I didn't see the same option to reformat.

What's the name of the other editor you use? The one that was recommended by LWD for the authoring kit?

You need to add the XML plug-in to Notepad++, then you get the "XML Tools" option in the "Plugins" menu. That menu offers various "Pretty Print" options to reformat your text.

I can confirm that RealmWorks doesn't care about blank space. I have been providing it with the nicely indented XML files for a long time without any problems.

Your editor must be making some fundamental error in the XML file for it to fail to load into RW.
 
It has to be <contents/> Just as XML is supposed to ignore whitespace outside of tags it does not ignore it inside of tags.

In my untouched, unedited, full export, it ends with:
Code:
</category_global></structure><contents /></export>

There's definitely a space in there. I tried removing it, and it doesn't make a difference.

Either way, when Powershell reads that node, it sees it either as an empty string or a null value, depending on how I read it (dot notation vs. xpath), and it won't let me do anything XML-ish with it.

I'm going to be using categories anyway, so I could just create those categories in the file I'm going to modify, and let that be the end of it, but there's still that part of me that says there has GOT to be a way to do this.
 
Either there is something fishy with the editor you're using, seems likely according to Farling, or there is something wrong with the Powershell parser as compared to the XML standard which is also possible.
 
Either there is something fishy with the editor you're using, seems likely according to Farling, or there is something wrong with the Powershell parser as compared to the XML standard which is also possible.

It's the PowerShell parser. Since there is nothing, absolutely nothing in that node, PowerShell doesn't automatically see it as an XML node. It sees it as an empty string.

I just found a way to force it to read it as an object, and it's parsing it correctly now.

As much as I like PowerShell, it does have its quirks. Variable types are dynamic. It doesn't have a clean, clear, reliable way to say, variable x will always be a string, and variable y will always be an integer. It does it on the fly.

In many cases, that's convenient, and in many cases, it's absolutely frustrating.

For anyone who's curious, instead of doing this:
Code:
$contents = $RWExportData.export.contents

I did this:
Code:
$contents = $RWExportData.export.ChildNodes | Where-Object {$_.name -eq "contents"}

And that did the trick. Problem is that when Powershell saves the edited xml, it saves it as formatted XML. So I may have to find or figure out that regex after all. We'll see how this import goes ...
 
Back
Top