PDA

View Full Version : XML Parse Error I can't track down...



GrimmSpector
February 22nd, 2016, 03:11
Hello, working on modifying CoreRPG into a new ruleset, but getting the following error when trying to load up the ruleset. If I remove the included file at the top, the error doesn't occur. But the file doesn't have anything in it that I can tell should cause it, it's just an empty class with some setup put together for doing up the main sheets attribute section nicely.

Error: An XML parse error occurred processing file campaign/record_char_mail.xml - Error on line 9: Error reading Attributes.

Here's the file throwing the error:


<?xml version="1.0" encoding="iso-8859-1"?>

<!--
Please see the license.html file included with this distribution for
attribution and copyright information.
-->

<root>
<include source "charsheet_listclasses.xml" />
<windowclass name="charsheet_main">
<margins control="0,0,0,2" />
<sheetdata>

</sheetdata>
</windowclass>

<windowclass name="char_main_category_header">
<margins control="0,0,0,5" />
<frame>rowshade</frame>
<sheetdata>
<genericcontrol name="leftanchor">
<anchored height="0" width="0">
<top offset="5" />
<left offset="10" />
</anchored>
</genericcontrol>

<genericcontrol name="rightanchor">
<anchored height="0" width="0">
<top offset="5" />
<right offset="-10" />
</anchored>
</genericcontrol>

<stringfield name="label">
<anchored>
<top offset="5" />
<left offset="30" />
<right offset="-30" />
</anchored>
<stateframe>
<keyedit name="fieldfocus" offset="7,5,7,5" />
<hover name="fieldfocus" offset="7,5,7,5" hidereadonly="true" />
<drophilight name="fieldfocus" offset="7,5,7,5" hidereadonly="true" />
</stateframe>
<font>reference-b-large</font>
<multilinespacing>20</multilinespacing>
<center />
</stringfield>
</sheetdata>
</windowclass>
</root>


And here's the included file who's removal appears to stop the error:


<?xml version="1.0" encoding="iso-8859-1"?>

<root version="1.0">
<windowclass name="charsheet_attribute">
<sizelimits>
<maximum>
<height>23</height>
</maximum>
<minimum>
<height>23</height>
</minimum>
</sizelimits>
<sheetdata>
<numbercontrol name="order">
<bounds>0,0,0,0</bounds>
<invisible />
</numbercontrol>
<stringcontrol name="label">
<anchored>
<position>insidetopleft</position>
<offset>0,6</offset>
<size>
<width>95</width>
<height>17</height>
</size>
</anchored>
<font>sheetlabel</font>
<static />
</stringcontrol>
<numberfield name="score">
<anchored>
<position>insidetopleft</position>
<offset>100,1</offset>
<size>
<width>35</width>
<height>20</height>
</size>
</anchored>
<font>sheettext</font>
<frame>
<name>modifier</name>
<offset>5,4,5,4</offset>
</frame>
<keyeditframe>
<name>sheetfocus</name>
<offset>5,4,5,4</offset>
</keyeditframe>
</numberfield>
<numberfield name="link">
<anchored>
<to>score</to>
<position>right</position>
<offset>15</offset>
<size>
<width>35</width>
</size>
</anchored>
<font>sheettext</font>
<frame>
<name>modifier</name>
<offset>5,4,5,4</offset>
</frame>
<keyeditframe>
<name>sheetfocus</name>
<offset>5,4,5,4</offset>
</keyeditframe>
</numberfield>
<numberfield name ="XP">
<anchored>
<to>link</to>
<position>right</position>
<offset>15</offset>
<size>
<width>35</width>
</size>
</anchored>
<font>sheettext</font>
<frame>
<name>modifier</name>
<offset>5,4,5,4</offset>
</frame>
<keyeditframe>
<name>sheetfocus</name>
<offset>5,4,5,4</offset>
</keyeditframe>
</numberfield>
</sheetdata>
</windowclass>
</root>


I'm pretty new at this, so I'm not sure what's happening here. Probably something quite silly that I've messed up. Some help would be very much appreciated, thanks!

Trenloe
February 22nd, 2016, 03:22
Make line #9: <include source="charsheet_listclasses.xml" /> You were missing the equals sign.

Recommendation for tracking these issues down - load the XML into Notepad++ with the XML plugin enabled, then use Plugins -> XML Tools -> Check XML Syntax. This won't always give you an exact error reason/location, but in this case it did point to the problem line immediately.

GrimmSpector
February 22nd, 2016, 03:28
Oh geez...told you it would be something silly! It's always little things like that when I write anything.

Thanks Trenloe, you're so helpful and patient around here, and you guys are so fast at replying to things. Very thankful. Once I slog through enough of the xml setup I can get to actually scripting functionality, think that will go better, I was never great at GUI setups!