Quantcast
Channel: Questions in topic: "parser"
Viewing all articles
Browse latest Browse all 108

Xml parser through C sharp

$
0
0
Green10002RED10001.5Blue10001 this is my xml file i want to get the the score values using UnityEngine; using System.Collections; using System.Xml; public class Parsing : MonoBehaviour { public static int[] Values=new int[3]; void Start() { XmlDocument newone=new XmlDocument(); newone.Load("new.xml"); XmlNodeList xnlist1=newone.SelectNodes("/spheres/sphere1/score"); XmlNodeList xnlist2=newone.SelectNodes("/spheres/sphere2/score"); XmlNodeList xnlist3=newone.SelectNodes("/spheres/sphere3/score"); foreach(XmlNode xn1 in xnlist1) { Values[0]=int.Parse(xn1.InnerText); } foreach(XmlNode xn2 in xnlist2) { Values[1]=int.Parse(xn2.InnerText); } foreach(XmlNode xn3 in xnlist3) { Values[2]=int.Parse(xn3.InnerText); } Debug.Log(Values[0]); Debug.Log(Values[1]); Debug.Log(Values[2]); } } this parsing i m doing its working correct in unity but when i build it and try to run on web my Values[0],Values[1] and Values[2] goes to 0.... if anyone can help me....

Viewing all articles
Browse latest Browse all 108

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>