Hi all,
I'm having a little bit of difficulty finding any resources on the permitted layout of XML files which can be loaded by the XNA content pipeline. Essentially, I've written a python script that exports vertices and edges (lines) from blender to an XML format of my own design, this format looks like this (taken straight from my resulting XML file):
| <?xml version="1.0" encoding="utf-8" ?> |
| <object> |
| <vertices> |
| <vertex x="0.000000" y="0.000000" z="0.000000"/> |
| <vertex x="1.000000" y="-1.000000" z="-0.003800"/> |
| <vertex x="2.000000" y="-1.000000" z="-0.003800"/> |
| <vertex x="2.200000" y="-0.600000" z="-0.003800"/> |
| <vertex x="2.400000" y="-0.600000" z="-0.003800"/> |
| <vertex x="2.700000" y="-1.400000" z="-0.003800"/> |
| <vertex x="3.100000" y="-1.600000" z="-0.003800"/> |
| <vertex x="3.500000" y="-1.400000" z="-0.003800"/> |
| <vertex x="3.700000" y="-0.800000" z="-0.003800"/> |
| <vertex x="4.000000" y="-0.800000" z="-0.003800"/> |
| </vertices> |
| <edges> |
| <edge vert0="0" vert1="1"/> |
| <edge vert0="2" vert1="1"/> |
| <edge vert0="3" vert1="2"/> |
| <edge vert0="4" vert1="3"/> |
| <edge vert0="4" vert1="5"/> |
| <edge vert0="6" vert1="5"/> |
| <edge vert0="7" vert1="6"/> |
| <edge vert0="8" vert1="7"/> |
| <edge vert0="8" vert1="9"/> |
| </edges> |
| </object> |
| |
Unfortunately, XNA doesn't like this format, refusing to compile when its included in the project. I have since descovered that there is a propriatary format for XML in XNA. I've found a couple of examples of loading XML (e.g. Nick Gravelyn's article on Ziggyware: http://www.ziggyware.com/readarticle.php?article_id=150), but this doesn't appear to have the level of detail I'm looking for (i.e. dealing with nested elements).
I'm fairly new to XNA development and I was wondering if anyone could point out some tutorials that focus on XML files for XNA specifically or some sort of reference as to valid XML markup for XNA and how to load and process them. Ultimately, I'm looking for a List of Vector2 or Vector3 containing the information defined in the vertices section and a List of int[2] (indices to vertices) defining the lines.
Does anyone have any ideas?
Much appreciated,
Andy