- Home /
How to load a resource xml with XmlReader
I've created a LoadXml class that can load and parse an XML file (in the editor). When I build the project, the file is not exported. I looked around and saw that I should put the file in the resources folder. It doesn't make sense to store this file as some kind of public variable of a script because the XML reader needs a file location to load.
When I look in the resources folder of my built project, I still don't find the XML file. Resources.Load will only give me a text asset, and the XMLReader can't be created from that.
Any ideas?
Answer by Jake.OConnor · Jul 12, 2013 at 07:17 PM
If you're XMLReader and LoadXML classes are looking for a file path, and not the actual file, then place the XML file in your StreamingAssets folder and pass in the path from there. Items put in your StreamingAssets folder will be copied over to the system as-is.
Either that or just hook up the XML as a TextAsset and pass in the contents of the file.
Your answer
Follow this Question
Related Questions
path of xml file 1 Answer
Load xml from resource folder after build(web player) 0 Answers
How to check the path on Android 0 Answers
Get path to loaded resource. 1 Answer