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

How can I find specific parts of an XML and feed them into dialogue?

$
0
0

I've tried googling and searching Unity Answers/Forums, but all I come up with are things to load entire XML documents. What I would like to do is make a Javascript (preferably Java) that will allow me to read specific dialogue lines from an XML file.

I got this, which seems to be similar to what I need: http://www.csharpfriends.com/Articles/getArticle.aspx?articleID=312&page=1 (also found an XML parser, but that loads entire XMLs as well[?]: http://forum.unity3d.com/viewtopic.php?t=40708&highlight=xml+parse)

But I have no idea how I would turn this into Javascript, I'm really a beginner.

So, in short, I want a script that can read, for instance, this XML:

<scenes><scene1><actor>Bob</actor><line1>"Oh, hi thare!"</line1><line2>"This is my second line."</line2></scene1><scene2><actor>Bill</actor><line1>"I'm another actor!"</line1></scene2></scenes>

Naturally I would want to load that function from another script. I hope you can help me out! If there is more information needed, I'll be happy to supply it.


Viewing all articles
Browse latest Browse all 108

Trending Articles



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