We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › Importing XML & displaying text
Page Index Toggle Pages: 1
Importing XML & displaying text (Read 578 times)
Importing XML & displaying text
Nov 4th, 2007, 5:25pm
 
import processing.xml.*;
XMLElement xml;

void setup() {
size(600, 600);
}

void draw() {
 background(255,255,255);
 xml = new XMLElement(this, "http://ws.audioscrobbler.com/1.0/tag/toptags.xml");
 

...


}
}

I'm having trouble finding a way to get the XML to display as text that I can format & style - all the examples I'm finding are for pulling values and manipulating them as values for objects. Any ideas?
Re: Importing XML & displaying text
Reply #1 - Nov 5th, 2007, 4:34am
 
Quote:
all the examples I'm finding are for pulling values


And then display them?

That's what the xml library is for. Pulling values. Displaying them is up to you. There is no generalized way to display information from XML.

If you're still confused...
http://en.wikipedia.org/wiki/Xml
Quote:
Its primary purpose is to facilitate the sharing of structured data across different information systems, particularly via the Internet.[2] It is used both to encode documents and serialize data.


So you have to parse (in this case Last.fm data it looks like) it manually and extract the information in a way that your own program can make sense of. There isn't an easy answer to your question.
Page Index Toggle Pages: 1