XML Suggestion

AlphaLaser, Sat Mar 22 2008, 03:56AM

Hello!

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.
Re: XML Suggestion
MLeoDaalder, Mon Mar 31 2008, 06:06AM

I 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.
Re: XML Suggestion
James, Tue Apr 01 2008, 07:00PM

*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.
Re: XML Suggestion
James, Tue Apr 01 2008, 09:06PM

user export file should now be fixed as well.

Ran out of time for tonight, but will work on your request AlphaLaser soon.
Re: XML Suggestion
Nicolas, Tue Apr 01 2008, 09:12PM

Escaping the xml chars in the get_user web rpc should be fixed.

James
What is that? PHP already has it built-in: htmlspecialchars.
Re: XML Suggestion
James, Wed Apr 02 2008, 07:45AM

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.
Re: XML Suggestion
Nicolas, Wed Apr 02 2008, 03:39PM

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.

James
function escape_xml_special_chars ($text) {
    $text = htmlspecialchars_decode($text);
    $text = htmlspecialchars($text);
    return $text;
}
Re: XML Suggestion
MLeoDaalder, Thu Apr 03 2008, 08:09AM

Thanks James!

That saves me from writing my own xml parser (or maiming an existing one).
Re: XML Suggestion
MLeoDaalder, Thu Apr 03 2008, 08:47AM

I'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?
Re: XML Suggestion
James, Thu Apr 03 2008, 09:00AM

[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.

James
function 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*
Re: XML Suggestion
MLeoDaalder, Thu Apr 10 2008, 04:59AM

According to the comment, this ought to make htmlspecialcharcs compatible with xml.
http://nl2.php.net/manual/en/function.htmlspecialchars.php#82410

You may want to use a different mirror. blum3
Re: XML Suggestion
AlphaLaser, Wed May 28 2008, 04:21AM


*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.

James

Late post, but thanks for fixing the URL! No rush on the XML update either, I've been busy as well smile3
Re: XML Suggestion
Arianna, Wed Sep 19 2012, 05:19AM

Thanks for shared great suggestion about xml language...!!!!
If you have any suggestion about Android Application Development than please shared with us...!!!
Re: XML Suggestion
Arianna, Tue Oct 30 2012, 05:21AM

Awesome post.Thanks for shared such a informative post and also its really helpful for xml creators...


Android jelly bean application Development