Click to See Complete Forum and Search --> : XML naming problems


GrumThePirate
01-29-2008, 07:12 AM
I have an XML file like the following (although I've simplified it alot for this post> that I am reading with C# but the problem is that it can't deferentiate with the Animation section in the first Sprite section and the animation section in the second sprite. I read something about namespaces to help with naming problems but I didn't understand it, could anyone here help me out with my problem?

<sprites>
<sprite>
<id>0</id>
<ref>0</ref>
<name>Knight 1</name>
<mass>10.0</mass>
<jumpForce>2.0</jumpForce>
<moveVelocity>1.0</moveVelocity>
<image>Graphics\Levels\Sprites\knt1.png</image>
<controls>player</controls>
<initialAnim>move-up</initialAnim>
<startAnimating>true</startAnimating>

<animation>
<id>0</id>
<looping>FALSE</looping>
<width>64</width>
<height>32</height>
<frames>2</frames>
<xOffset>0</xOffset>
<yOffset>0</yOffset>
<action>move-up</action>
</animation>
</sprite>

<sprite>
<id>1</id>
<ref>1</ref>
<name>Knight 2</name>
<mass>10.0</mass>
<jumpForce>2.0</jumpForce>
<moveVelocity>1.0</moveVelocity>
<image>Graphics\Levels\Sprites\knt1.png</image>
<controls>player</controls>
<initialAnim>move-upht</initialAnim>
<startAnimating>true</startAnimating>

<animation>
<id>0</id>
<looping>FALSE</looping>
<width>64</width>
<height>32</height>
<frames>2</frames>
<xOffset>0</xOffset>
<yOffset>0</yOffset>
<action>move-up</action>
</animation>

<animation>
<id>1</id>
<looping>FALSE</looping>
<width>64</width>
<height>32</height>
<frames>2</frames>
<xOffset>64</xOffset>
<yOffset>0</yOffset>
<action>move-down</action>
</animation>
</sprite>

</sprites>