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.
IndexProcessing DevelopmentLibraries,  Tool Development › proxml: path to documentURL / loadFrom()
Pages: 1 2 
proxml: path to documentURL / loadFrom() (Read 5459 times)
proxml: path to documentURL / loadFrom()
Sep 8th, 2005, 6:33pm
 
hi there,

i have an ugly problem with the fileimport/absolutePath in an applet that bases on proxml:

proxml works fine in the environment by loading the xmlfile with the function:
xxx.loadFrom(folder + "/thefile.xml");

BUT: after exporting as applet, the xml file is not found and the applet won't start.

if i include 'folder' in the error output of the catchstatement, it will print 'null' in the javaconsole of the browser

PLUS: if i try to get the absolute path > getAbsolutePath() etc. of thefile.xml, the applet wont't get the permission to read dir.

btw.: relativepath (without 'folder')to the xml file does work in the environment; not as applet.

does anyone has an idea how to
either assign the relative path from thefile.xml to the function loadFrom() or setDocumentUrl()
or read thefile.xml as String[] lines; etc and assign that completely to proxml ?

(or does this problem simply base on wrong placement of the xml file location in the appletfolder)

the last 2 days i made desperate efforts to fix that problem. if anybody has some helpfull hints...

cu:MissYen
Re: proxml: path to documentURL / loadFrom()
Reply #1 - Sep 10th, 2005, 1:03pm
 
UPDATE to the previously posted problem:
used nanoxml instead of proxml. that's slightly more complicated to use than proxml, but with nanoxml i can assign the inputstream of the file to the xml element. (hm... liked proxml better, but at least i got it to work as applet.)

cu:MissYen
Re: proxml: path to documentURL / loadFrom()
Reply #2 - Sep 10th, 2005, 3:31pm
 
Hello MissYen

I never tested proXML with applets my mistake. I tried to get an applet run but it was not possible. I will try to fix this as soon as possible and post the progress here.

tex
Re: proxml: path to documentURL / loadFrom()
Reply #3 - Sep 10th, 2005, 5:46pm
 
hi tex,
thanks for your reply (and for your great piece work with proxml at all).
while my effords to get proxml running i took a look at your library, but i didn't find a public function to assign something like an input stream to. (probably my fault.)

[ perhabs there should be a public funktion for something like private Reader openXMLFile(String file)?
... of course, it's your code and you'll know it best Smiley ]

well, basically, if you try to parse the path via any java.io function (to assign that string to 'folder') the applet will throw a security error. so either you have to sign the applet (yuk!) or you have to find a way to read data or file from relative path from inside your folder/server. so far ... looking forward for the next proxml version. good luck with fixing.

cu:MissYen
Re: proxml: path to documentURL / loadFrom()
Reply #4 - Nov 9th, 2005, 7:57pm
 
Hi everyone,

has there been a solution to the Applet problem yet.

I tried to make an Applet just out of the included Example
and it didn't work.

Any hint would be great looking forward to put proXML stuff online.

Re: proxml: path to documentURL / loadFrom()
Reply #5 - Nov 11th, 2005, 9:34am
 
Hi

infact the actual proxml version should work, look at this example:

http://texone.org/proxmlapplet/

If you want to load xml from an external source you have to redirect it with php. If it is still not working give me your example code.
Re: proxml: path to documentURL / loadFrom()
Reply #6 - Nov 12th, 2005, 11:46am
 
hi there,
short update ref. xml parsing >without php redirection< using nanoxml

the applet:
http://lehre.hki.uni-koeln.de/~kurz/ps05/Seminararbeiten/hoehne/applet/index.html

the sourcecode:
http://lehre.hki.uni-koeln.de/~kurz/ps05/Seminararbeiten/hoehne/dateien/quelltext.txt
see >
//  XML PARSEN UND DATEN DEN KLASSEN/INSTANZEN ZUWEISEN
void dateiLaden() and void parseXml() ~ in the middle of sourcecode

for anyone who's interested and does understand german > the paper:
http://lehre.hki.uni-koeln.de/~kurz/ps05/Seminararbeiten/hoehne/index.html

hope it might help.
cu:MissYen
Re: proxml: path to documentURL / loadFrom()
Reply #7 - Nov 12th, 2005, 12:06pm
 
Hi This would work with proXML now, too and without the need of an InputReader, you only need php redirection for XML files from external urls for example flickr. But this is caused by the java applets security restrictions. The example I gave is working without php.

http://texone.org/proxmlapplet/

Please check the new version It loads xml files also in the applet.
Re: proxml: path to documentURL / loadFrom()
Reply #8 - Nov 15th, 2005, 9:10pm
 
ahh... very cool!
and thanks again for your great work.  Smiley
Re: proxml: path to documentURL / loadFrom()
Reply #9 - Nov 25th, 2005, 6:59am
 
proxml seems broken with 0.95, due to renaming the folder variable to the path variable.

I attempted changing the pApplet.folder strings to pApplet.path in XLMInOut.java, but to no avail.

Any chance for an update anytime soon?

Thanks,
Re: proxml: path to documentURL / loadFrom()
Reply #10 - Nov 25th, 2005, 7:59am
 
Duh, I forgot to recompile the .class files. I was getting some errors with 0.95 when compiling XMLInOut.java, line 245 :


Code:

vade$ javac -d . -classpath /Applications/Programming/processing-0095/lib/core.jar *.java
XMLInOut.java:245: cannot resolve symbol
symbol  : method toURI ()
location: class java.net.URL
                               file = new File(pApplet.getClass().getResource("data/" + filename).toURI());
                                                               ^
1 error


I dont know java well enough to fix it, so I just copied another line, and probably broke something. But, i was able to load in files just fine. Thanks, look forward to a new point release!

Also, since this is useful for reading in RSS and ATOM feeds, is it possible to remove the needed <?xml /> firsttag, and possibly check for <feed /> or something like such? (some feeds validate without the <?xml /> tag initially.

Thanks!
Re: proxml: path to documentURL / loadFrom()
Reply #11 - Nov 25th, 2005, 10:36am
 
The new proXML lib is online. It only deals the change from folder to path in the new processing version. I will take care for feeds later.

Re: proxml: path to documentURL / loadFrom()
Reply #12 - Nov 25th, 2005, 10:37pm
 
Thanks tex. Fast response and much appreciated, its working fine here.

tex wrote on Nov 25th, 2005, 10:36am:
The new proXML lib is online. It only deals the change from folder to path in the new processing version. I will take care for feeds later.


Re: proxml: path to documentURL / loadFrom()
Reply #13 - Dec 6th, 2005, 7:02pm
 
Hi there, I just downloaded the new version of proXML and was trying to run the
Example application, but I always get:

java.lang.NoSuchFieldError: path

In both p91 and p97

When I tried my proccessing application I get the following:
apple.awt.EventQueueExceptionHandler Caught Throwable : java.lang.NoSuchFieldError: path

is this cause I am on osX ?

Thanks,  
Elmar
Re: proxml: path to documentURL / loadFrom()
Reply #14 - Dec 6th, 2005, 7:29pm
 
Hi Elmar

The reason is that there have been some change in the last releases. First it was folder in 0.96 it was path and now it is sketchpath.

I will upload the update as soon as possible definetly this week. For the moment you could use version 0.96
Pages: 1 2