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 › XMl error , dont get it
Page Index Toggle Pages: 1
XMl error , dont get it (Read 581 times)
XMl error , dont get it
May 30th, 2008, 1:00am
 
Hi all , im using nanoxml lite. i have created a code folder and extracted the 2 class files from nano into the approrpiate folder (nanoxml). I have been looking through the code and narrowed it down to this:

Code:

import processing.xml.*;


XMLElement xml;

void setup() {
size(200, 200);


}


Yet still i recieve this error, im new to processing and obviously havent got the hang of using packages , can anyone help :

Code:


C:/Users/Nic/AppData/Local/Temp/build22136.tmp/Temporary_4041_2848.java:6:1:6:10: Semantic Error: Type "XMLElement" is imported on demand from package "processing.xml" and package "nanoxml".







btw im using vista...













Re: XMl error , dont get it
Reply #1 - May 30th, 2008, 1:06am
 
AFAIK, NanoXML Lite is bundled by default with Processing.
So you don't have to add this library to Processing, it might be the cause of ambiguity.
Re: XMl error , dont get it
Reply #2 - May 30th, 2008, 1:16am
 
Fantastic no more error , much appreciated!
Re: XMl error , dont get it
Reply #3 - May 30th, 2008, 1:16am
 
right, you're doing too much work. by just including:

import processing.xml.*;

you'll have the nanoxml classes available to you. processing.xml is just a renamed (re-packaged) version of nanoxml.

http://processing.org/reference/libraries/xml/index.html
Re: XMl error , dont get it
Reply #4 - May 30th, 2008, 1:36am
 
Ok so now i understand reading from an XML on a local computer. could you point me in the right direction for reading from an online resource (xml)

thanks again

Nic
Re: XMl error , dont get it
Reply #5 - May 30th, 2008, 2:08am
 
I am trying to use this simple code

Code:



import processing.xml.*;

XMLElement xml;

void setup() {
size(200, 200);


xml = new XMLElement(this, "http://armory.wow-europe.com/character-sheet.xml?r=Shadowsong&n=Prospect");

int numSites = xml.getChildCount();
println(numSites); // Prints "2"

}



to access that specified XML page, yet still recieve an error:

Code:


processing.xml.XMLParseException: XML Parse Exception during parsing of a html element at line 18: Expected: /


is this jut a problem with the way that the document is kayed out or is there a way around it?

thanks

Nic
Re: XMl error , dont get it
Reply #6 - May 30th, 2008, 2:38am
 
probably the document, unless the same document was working ok when copied locally.

you might try using revision 0136, posted earlier today. it includes NanoXML instead of NanoXML Lite, which is less finicky about syntax.
Re: XMl error , dont get it
Reply #7 - May 30th, 2008, 9:22am
 
I have used the view source function inside firefox to make a local version of that XML file. this works fine but i imagine somethign to do with the nature by which the file is generated has somethign to do with the fact it wont wokrk, whta do you all think ?

I tried using the full nanoxml version also but just ended up with the same error as before which turned out to be a contradiction between processing's built in version of nano and the installed nano.

This is the site, maybe somebody could have a look and let me know what they think?

http://armory.wow-europe.com/character-sheet.xml?r=Shadowsong&n=Prospect


thanks again

Nic
Re: XMl error , dont get it
Reply #8 - May 30th, 2008, 1:19pm
 
FYI, in 0136, I get another exception (with the above code):
Code:
Nested Exception

at processing.xml.StdXMLParser.parse(StdXMLParser.java:204)

at processing.xml.XMLElement.parseFromReader(XMLElement.java:254)

at processing.xml.XMLElement.<init>(XMLElement.java:231)

at Temporary_8535_1807.setup(Temporary_8535_1807.java:9)


I downloaded the file (just right-click on the link you gave!) and validated it with the W3C service, it is valid XML.
Page Index Toggle Pages: 1