- Home /
XML Serializable "if"
I have created an xml file for a system with trophies and I would like a script (if) you were in control a certain thing written in the xml file as: hello I wish that the script in c # scrutiny as to whether there was evidence in the category really wrote hello, otherwise something would happen, how can I do?
Is your C# script using an X$$anonymous$$L parser? I would recommend against trying to do it by hand or with regular expressions.
n the file c # I have not "set" the xml but I know already as it gets, I just need the script to check if there was something written in the category
Answer by cmpgk1024 · Aug 16, 2013 at 01:01 PM
See the documentation for XMLSerializer. The XMLSerializer serializes the XML file into a class structure, so it would be something like
if(XMLRoot.test != null){
// do things here
}
Your class might not be named XMLRoot, though.
let me get this, ins$$anonymous$$d of XmlRoot should I put?
Read the X$$anonymous$$LSerializer docs that I linked. You can make a class able to load X$$anonymous$$L by adding
[XmlRootAttribute("YourClassName", Namespace="http://www.cpandl.com", IsNullable = false)]
before the class.
Your answer
Follow this Question
Related Questions
Convert XML Deserializer from folder to resources 2 Answers
XML parsing c# in unity 1 Answer
Invalid Encoding Specification Xml 1 Answer
Read AND Write to XML at runtime 1 Answer