Forums
XML Suggestion
-
16 years agoHello!
Wanted to first point out a typo in the stats URL given in the thread in Announcements. It points to http://boinc.netsoft-online.com/stats/l where it should be just http://boinc.netsoft-online.com/stats/
Secondly I was wondering of the possibility of an XML file aggregated by project? Something that gives the stats at the top of the page at http://boinc.netsoft-online.com/e107_plugins/boinc/bp.php?project=1 but in XML format. Even better would be to list the stats of all supported projects in a single XML file. My idea for this is that I'm looking to build a page of movers and shakers by project, and not having to process full user dumps for this would be ideal. -
16 years agoI actually have a question regarding the xml, the users.xml published on this website appears to contain mallformedness errors, for example, row 1090, column 15, a "rogue" ampersand (&) appears.
I'm trying to process the file, but none of the parsers I've tried can't get beyond that point (SAX/Xerces, XOM, StAX/Woodcrest). The environment I'm in is Java.
Is it possible to escape these or can you suggest an xml parser that can do this (and have it stream-able)?
An example user (the one above) is c5ec61c267a96cb37d499079c7895b4d
The same thing happens with individual users on this site (ie. http://boinc.netsoft-online.com/get_user.php?cpid=c5ec61c267a96cb37d499079c7895b4d).
But that user at for example http://einstein.phys.uwm.edu/ does have an escaped & but not on this site.
I hope this is can be fixed, since it isn't proper XML (otherwise) and I haven't been able to find an XML (stream) parser that can ignore part of the XML specifications. -
16 years ago*uber sigh* No, I'm not ignoring the comments, just very busy.
The url in the announcement should be fixed.
Escaping the xml chars in the get_user web rpc should be fixed. -
16 years agouser export file should now be fixed as well.
Ran out of time for tonight, but will work on your request AlphaLaser soon. -
16 years ago
What is that? PHP already has it built-in: htmlspecialchars.Escaping the xml chars in the get_user web rpc should be fixed.
James
-
16 years agoI looked at what was stored in the name fields in my DB - sometimes the entries were already escaped and sometimes not (not entirely sure why), so I couldn't just use the php function or in some cases you end up with a real mess. -
16 years agoI looked at what was stored in the name fields in my DB - sometimes the entries were already escaped and sometimes not (not entirely sure why), so I couldn't just use the php function or in some cases you end up with a real mess.
Jamesfunction escape_xml_special_chars ($text) { $text = htmlspecialchars_decode($text); $text = htmlspecialchars($text); return $text; }
-
16 years agoThanks James!
That saves me from writing my own xml parser (or maiming an existing one). -
16 years agoI've just downloaded it, and it seems to be partly resolved.
The name element of user c5ec61c267a96cb37d499079c7895b4d still has an unescaped & in it.
L&S IT Office
The project entry doesn't now.
But the url of user 93fd38421af91db4c3868f6128c9955e does have one in the Einstein@Home user_url element.
Is it possible that the import hasn't been done with the proper xml producing code yet? -
16 years ago[quote]I looked at what was stored in the name fields in my DB - sometimes the entries were already escaped and sometimes not (not entirely sure why), so I couldn't just use the php function or in some cases you end up with a real mess.
Jamesfunction escape_xml_special_chars ($text) { $text = htmlspecialchars_decode($text); $text = htmlspecialchars($text); return $text; }
[/quote1207230790]
That's fine for HTML, but not XML. The apostrophe is not translated correctly by the htmlspecialchars function (xml standard says it should end up as ' not #039 see http://www.w3.org/TR/REC-xml/ ). Looks like I mised the double quote yet. *sigh*