xmlsyntax-errornon-well-formed

The element type X must be terminated by the matching end-tag


I am making a mod for dungeons of dredmor. When I run the code through a syntax checker or a formatter I get this error:

Unable to parse any XML input. Error on line 6: The element type "skillDB" must be terminated by the matching end-tag "</skillDB>".

Here is my XML:

<skillDB>
<skill name="Gamblemancy" skillName="Gamblemancer" type="wizard" 
description="The magic of the felt. Will you heal your enemies? Hurt yourself? It's up to the dice! Or cards. Or slot machine"/>
    <art icon="\sprites\fillersprite.png" />
    <loadout type="booze" subtype="Deck Of Cards" />
</skill>
<ability>
    <name="Gamblemancy" icon="\sprites\fillersprite.png skillName="Gamblemancer" startSkill="1"
description="You are a gamblemancer! A holder of ultimate luck! And Debt!"/>
    <primarybuff id="5" amount="2" />
    <secondarybuff id="5" amount="2" />
</ability>
<ability>
    <name="Luck of the draw" icon="\sprites\fillersprite.png" skillName="Gamblemancer" level="0"
    description text="Pure luck courses through your veins! Except when it doesn't." />
    <criticalBuff percentage="90" name="Lucky shot" />
</ability>
<ability>
<name="Royal flush" icon="\sprites\fillersprite.png skillName="Gamblemancer" level="1"
description text="Royal Flush! You win! Except that you don't!" />
<spell name="Royal Flush" />
</ability>
<skill skillName="Another skill tree's name">
    <!--This is where some basic information about the skill tree goes-->
</skill>
  <ability skillName="Another skill tree's name" startSkill="1">
      <!--This is where the first level of the skill tree goes-->
  </ability>
  <ability skillName="Another skill tree's name" level="0">
      <!--This is where the second level of the skill tree goes-->
  </ability>
  <ability skillName="Another skill tree's name" level="1">
      <!--This is where the third level of the skill tree goes-->
  </ability>
 </skillDB>

Solution

  • There are several syntactic issues with your XML, including:

    1. The first skill element has an opening tag that is self-closing and an end tag. Delete the / character:

      <skill name="Gamblemancy" skillName="Gamblemancer" type="wizard"
             description="The magic of the felt. Will you heal your enemies? 
             Hurt yourself? It's up to the dice! Or cards. Or slot machine"/>
                                                                           ^
      

      or remove the end tag:

      </skill>
      
    2. <name="Gamblemancy" is missing a tag name.

    3. Attribute values are missing closing quotes.

    There are so many that, without an XML schema or a sample known valid document instance, it's hard to know how to repair. Here's one possibility that is at least well-formed:

    <skillDB>
      <skill name="Gamblemancy" skillName="Gamblemancer" type="wizard" 
             description="The magic of the felt. Will you heal your enemies? Hurt yourself? It's up to the dice! Or cards. Or slot machine">
        <art icon="\sprites\fillersprite.png"/>
        <loadout type="booze" subtype="Deck Of Cards"/>
        <ability>
          <NEEDTAG name="Gamblemancy" icon="\sprites\fillersprite.png" skillName="Gamblemancer" startSkill="1"
                   description="You are a gamblemancer! A holder of ultimate luck! And Debt!"/>
          <primarybuff id="5" amount="2" />
          <secondarybuff id="5" amount="2" />
        </ability>
        <ability>
          <NEEDTAG name="Luck of the draw" icon="\sprites\fillersprite.png" skillName="Gamblemancer" level="0"
                   description="Pure luck courses through your veins! Except when it doesn't." />
          <criticalBuff percentage="90" name="Lucky shot" />
        </ability>
        <ability>
          <NEEDTAG name="Royal flush" icon="\sprites\fillersprite.png" skillName="Gamblemancer" level="1"
                   description="Royal Flush! You win! Except that you don't!" />
          <spell name="Royal Flush" />
        </ability>
      </skill>
      <skill skillName="Another skill tree's name">
        <!--This is where some basic information about the skill tree goes-->
      </skill>
      <ability skillName="Another skill tree's name" startSkill="1">
        <!--This is where the first level of the skill tree goes-->
      </ability>
      <ability skillName="Another skill tree's name" level="0">
        <!--This is where the second level of the skill tree goes-->
      </ability>
      <ability skillName="Another skill tree's name" level="1">
        <!--This is where the third level of the skill tree goes-->
      </ability>
    </skillDB>