XionGaTaosenai wrote:This mod doesn't append. It clobbers.
If that's all it reported, you DO have valid XML, both in the eyes of a strict parser and the custom sloppy parser that tries to mimic FTL's typo tolerance.
XionGaTaosenai wrote:This mod doesn't append. It clobbers.
Hm. I think it'd be quickest if you just sent the me your mod so I can see where it fails, and fix the bug...
I had this several times during testing -- never really noticed a pattern why it happens, but I think it should be the error that caused the checker to spill its guts. If you double click it, it'll probably crash the app.
XionGaTaosenai wrote:I had this several times during testing -- never really noticed a pattern why it happens, but I think it should be the error that caused the checker to spill its guts. If you double click it, it'll probably crash the app.
I double-clicked the syntax error in tooltips, and it didn't crash the app, instead just highlighting the copyright notice at the top of the tooltips file, saying something about an "unexpected exception:null".
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2012 by Subset Games. All rights reserved -->
<!--**********ITEM BLUEPRINTS**********-->
<stuff>
<itemBlueprint name="fuel">
...
Code: Select all
...
</shipBlueprint>
</stuff>
Code: Select all
<crewBlueprint name="human">
<title>Human</title>
<short>Human</short>
<desc>Humans are common and uninteresting.</desc>
<cost>40</cost>
<rarity>1</rarity>
<powerList>
<power>No exceptional traits</power>
</powerList>
<crewBlueprint> <------ missing forward slash
Code: Select all
<weaponBlueprint name="MISSILES_2_PLAYER">
<type>MISSILES</type>
<title>Missiles!</title>
<short>Missile</short>
<desc>Missiles go right through enemy ships, but use up limited ammo. Don't run out!</desc>
<tooltip>Fires 1 missile that does 2 damage, Uses 1 missile</tooltip>
<damage>2</damage>
<shots>1</shots>
<sp>5</sp>
<fireChance>0</fireChance>
<breachChance>0</breachChance>
<cooldown>11</cooldown>
<power>1</power>
<missiles>1</missiles>
<cost>40</cost>
<rarity>0</rarity>
image>missile_2</image> <----------- missing opening triangle bracket
<launchSounds>
<sound>smallMissile1</sound>
<sound>smallMissile2</sound>
</launchSounds>
<hitShipSounds>
<sound>smallExplosion</sound>
</hitShipSounds>
<hitShieldSounds>
<sound>hitShield1</sound>
<sound>hitShield2</sound>
<sound>hitShield3</sound>
</hitShieldSounds>
<missSounds>
<sound>miss</sound>
</missSounds>
<weaponArt>missiles_1</weaponArt>
</weaponBlueprint>
5thHorseman wrote:The problem is, the blueprints.xml that comes with the game also fails to validate XML. You can't find an error that will hurt FTL with a validator, at least not most of the time.
Search for the text:
image>missile_2</image>
and make it:
<image>missile_2</image>
Vhati wrote:5thHorseman wrote:The problem is, the blueprints.xml that comes with the game also fails to validate XML. You can't find an error that will hurt FTL with a validator, at least not most of the time.
That's exactly the sort of thing I was hoping to find.
I would've thought the sloppy parser might accept that, but that the strict one would choke and hint at the location (that it'd be treated as an extraneous mismatched closing tag).
Code: Select all
> data/blueprints.xml
~ Strict XML Parser Issues:
! <?xml... ?> should only occur on the first line.
! <persDamage...>...</persdamage>
! <shipBlueprint>...</ship>
! Fix this and try again:
org.jdom2.input.JDOMParseException: Error on line 604: The element type "weaponBlueprint" must be terminated by the matching end-tag "</weaponBlueprint>".
~ ~ ~ ~ ~
image>missile_2</image>
~ ~ ~ ~ ~
~ This mod doesn't append. It clobbers.
Code: Select all
> data/blueprints.xml
~ Strict XML Parser Issues:
! <?xml... ?> should only occur on the first line.
! <persDamage...>...</persdamage>
! <shipBlueprint>...</ship>
! Fix this and try again:
org.jdom2.input.JDOMParseException: Error on line 2114: The element type "weap
onList" must be terminated by the matching end-tag "</weaponList>".
~ ~ ~ ~ ~
</weaponlist>
~ ~ ~ ~ ~
~ This mod doesn't append. It clobbers.
Code: Select all
! Fix this and try again:
org.jdom2.input.JDOMParseException: Error on line 2167: The element type "weap
onList" must be terminated by the matching end-tag "</weaponList>".
~ ~ ~ ~ ~
</weaponlist>
~ ~ ~ ~ ~
Code: Select all
! Fix this and try again:
org.jdom2.input.JDOMParseException: Error on line 3248: The element type "crew
Blueprint" must be terminated by the matching end-tag "</crewBlueprint>".
~ ~ ~ ~ ~
</wrapper>
~ ~ ~ ~ ~
Code: Select all
<crewBlueprint name="human">
<title>Human</title>
<short>Human</short>
<desc>Humans are common and uninteresting.</desc>
<cost>40</cost>
<rarity>1</rarity>
<powerList>
<power>No exceptional traits</power>
</powerList>
<crewBlueprint>
So it IS working as intended.
5thHorseman wrote:I made the XML valid (by removing the copyright notice and adding a huge wrapper around the rest of the file like you need to to make a valid XML file)
[...]
EDIT:
That was just to get the validator to work.