How to find certain items in an xml?

这一生的挚爱 提交于 2019-12-13 01:24:59

问题


I have an xml and all, and the good thing is, I can run it in processing. So when I press run, in the box in the bottom I get all the scores of all the teams. Why, here's the code:

XML xml;

void setup() {
  xml = loadXML("http://www.scorespro.com/rss2/live-basketball.xml");
  XML[] channel = xml.getChildren("channel");
   //println(xml);
  for (int i = 0; i < channel.length; i++) {
    String item = channel[i].getString("title");
    String name = channel[i].getContent();
    println(channel);
  }
}

Now I am wondering. I only want to get for example the Miami Heat's score. Is that possible?


回答1:


Processing has a built-in XML library that can do exactly what you're looking for.



来源:https://stackoverflow.com/questions/29584567/how-to-find-certain-items-in-an-xml

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!