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 › XMLElement wont work in browser
Page Index Toggle Pages: 1
XMLElement wont work in browser (Read 285 times)
XMLElement wont work in browser
Feb 25th, 2009, 5:33pm
 
Hey guys,

Forgive me, for this seems like a common problem but I searched the site and could not find anything that would help me.

Im using XMLElement to take RSS feeds from the web and use them in my sketch.  However, when I go live on the web with my sketch it will not play in the browser and gives me a blank canvas.

I am not using proxml but should I?  Will I need to use some kind of server friendly language like PHP or Ruby??

My code is simple right now for demo purposes but I will post it anyways:

Code:

PFont font;

void setup() {
size(200,200);
font = loadFont("Dialog-48.vlw");
// Download RSS feed
String url = "http://uncammac.wordpress.com/feed/";
XMLElement rss = new XMLElement(this, url);
// Get all <title> elements
XMLElement[] titles = rss.getChildren("channel/item/title");
for (int i = 0; i < titles.length; i++) {
println(titles[i].getContent());
}
textFont(font);
textSize(12);
fill(0);
String s = titles[2].getContent();
text(s,10,10,150,150);
}


Thanks again for listening

dnice
Re: XMLElement wont work in browser
Reply #1 - Feb 25th, 2009, 5:47pm
 
Yes, it is a common, classical problem! Wink

For security reasons, applets cannot access local filesystem nor files on servers other than the one serving the page where the applet lives.
Fortunately, there is a workaround: you must sign the applet (I think there is a Hacks about this -- yes, here it is: How to sign an applet).
After that, the browser will warn the users and ask them if they want to proceed.
Re: XMLElement wont work in browser
Reply #2 - Feb 25th, 2009, 7:37pm
 
Hey Philo,

thx for the quick reply

I tried doing that hack and others for signing my applet.  However, I get to the last step when it asks me to enter the passphrase for keystore.  I enter my password but then it spits out:

jarsigner: unable to open jar file: rss3.jar

I know you might not be able to answer this given you were just giving me a lead to look for things, but I am once again stuck so Id thought id continue the thread.
Page Index Toggle Pages: 1