Jump to content

XML error parsing attribute name


McGreagor
 Share

Recommended Posts

I am attempting to fill a deck of cards data similar to a TCG into a xml file so I can pull the data from it later in Unity using C#. The error I am getting when trying to run it in any web browser is:

 

This page contains the following errors:
error on line 6 at column 8: error parsing attribute name
Below is a rendering of the page up to the first error.

 

Here is the code starting at line 6:

 

<cardId ="01">
<type name = "Boss">
<title>Gorgona</title>
<xp>500 XP</xp>
<treasureIcon>Treasure</treasureIcon>
<heading>Queen of Medusia</heading>
<levelUp>Level Up: Choose a Hero in town. Immediately kill that Hero and place it face-down in your scorekeeping area.</levelUp>
</type>
</cardId>
I've looked over it but can't find what I am missing. If anyone could provide an answer that would be ideal. I am sure its something simple I am missing but I don't see it.
Link to comment
Share on other sites

Ok i attempted to fix this but still getting an error, you'll have to excuse me but my experience in xml is little.

 

Error now is:

This page contains the following errors:
error on line 6 at column 8: error parsing attribute name
Below is a rendering of the page up to the first error.

 

Fixed code starting at line 5 ending at 13:

 

<card Id ="01">
<type name ="Boss">
<title>Gorgona</title>
<xp>500 XP</xp>
<treasureIcon>Treasure</treasureIcon>
<heading>Queen of Medusia</heading>
<levelUp>Level Up: Choose a Hero in town. Immediately kill that Hero and place it face-down in your scorekeeping area.</levelUp>
</type>
</card Id>
And thanks for helping love this site!
Link to comment
Share on other sites

This isn't valid XML: </card Id>

It should be just </card>

 

I don't think it's a requirement in XML, but it would be better if you don't have spaces between your attribute names and values.

 

You should read the XML tutorial: http://www.w3schools.com/xml/default.asp

You need to understand the proper syntax for an XML document as well as what elements, tags and attributes are.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...