In my activity to get my RPG converted to monogame I am working on the pipeline tool as it failed in building that app. I have looked at the samples and they all build ok with my corrected pipeline but my app makes extensive use of xml and the current pipeline and mine both fail in the build process.
I would like to try my pipeline on a monogame that uses xml content to eliminate the possibility that my xml is not compatible and needs changing manually before it can be used in monogame.
Anyone got a sample I can have. Happy to agree to none disclosure and proof of deletion afterwards if required.
Ok. Got one. Using XMLContentLoadingSample from GitHub.
Hope this will help
using System;
using System.Collections.Generic;
using System.Xml;
namespace Space_Battles
{
public class XmlFileRead
{
#region public methods
public static List<List<string>> XmlDataToList(string pathToXmlFile)
{
XmlReader xmlReader = XmlReader.Create(pathToXmlFile);
List<List<string>> imageData = new List<List<string>>();
bool addToFile = false;
while (xmlReader.Read())
{
List<string> tempData = new List<string>(); // create a temp list to add data from each node
while (xmlReader.MoveToNextAttribute())
{
tempData.Add(xmlReader.Value);
addToFile = true;
}
if (addToFile)
{
imageData.Add(tempData);
addToFile = false;
}
}
// code below used to check the contents of the list returned
//for (int i = 1; i <= imageData.Count - 1; i++)
//{
// for (int j = 0; j < imageData[i].Count; j++)
// {
// Console.WriteLine(imageData[i][j]);
// }
//}
return imageData;
}
#endregion
}
}