CharonPirates.xml contains malformed XML

Found a bug in the game? Post it in one of the applicable sub forums depending on the version you are using. Tech support is also available in the Tech Support subforum.
Post Reply
User avatar
Shivan Hunter
Commonwealth Pilot
Commonwealth Pilot
Posts: 81
Joined: Tue Nov 29, 2011 3:07 am

not really a bug per se, but I'm trying to parse the source XML for reasons, and line 1678 of CharonPirates.xml is

Code: Select all

<!-- GLOBALS ------------------------------------------------------------------>
but a proper XML comment does not contain multiple hyphens except the "--" at the beginning and end. Presumably Transcendence's parser strips it out in preprocessing or handles it, but Java's XML parser (javax.xml.parsers.DocumentBuilder) fails on this line.

Not really an issue, I can get rid of it with a regex (in fact, my parser might as well discard anything matching "(?s)<!--.*?-->"). Just a heads up about an issue I ran into.

[EDIT]: aaaaaa bad tag names D:

Line 681 in MiscItems is a tag that throws an error because it doesn't start with a letter. I... may be able to deal with this using regex as well but blargh

[EDIT2]: looks like that's it! The only bad tag is "00182001_Donation" which I just internally replace all occurrences of with "a00182001_Donation" (but I won't be using it anyway).
I'm here to shift paradigms and chew bubblegum... and I'm all out of bubblegum.

<+The_Shrike> If you install 2 solar panels, you will have 2 solar panels installed.
<DarthGeek|2> :o
User avatar
Atarlost
Fleet Admiral
Fleet Admiral
Posts: 2391
Joined: Tue Aug 26, 2008 12:02 am

All Transcendence XML is malformed because it references entity definitions in other files.
Literally is the new Figuratively
Jeoshua
Militia Lieutenant
Militia Lieutenant
Posts: 163
Joined: Sat Sep 06, 2008 3:48 pm

Transcendence XML is not intended for the web, therefore is not subject to W3C conventions.
User avatar
Shivan Hunter
Commonwealth Pilot
Commonwealth Pilot
Posts: 81
Joined: Tue Nov 29, 2011 3:07 am

I know, and I by no means expect George to write his XML to any standard other than what Trans's own parser expects. Since I was parsing XML for my mod anyway, I thought I'd mention the minor issues I ran into since they're easily corrected.

About entities: there are several ways to get parsers to ignore entities. I just didn't bother with them and (again) used regexes to replace them with placeholders. I also didn't mention it because it's so integral to how the XML works it's obviously not going to change (and shouldn't).
I'm here to shift paradigms and chew bubblegum... and I'm all out of bubblegum.

<+The_Shrike> If you install 2 solar panels, you will have 2 solar panels installed.
<DarthGeek|2> :o
Post Reply