Jump to content
Sign in to follow this  
McGreagor

XML error parsing attribute name

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.

Share this post


Link to post
Share on other sites

This isn't valid XML <cardId ="01">

Perhaps you meant <card id="01"> or <cardId>01</cardId>

Share this post


Link to post
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!

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...