BuzzerBeater
BuzzerBeater Forums
BBAPI Support > I need help with XML encoding :(
Back to the Sneak Peek
BBAPI Support
Unknown in economy
1
(c)
2
BBAPI moved
26
handle the cookies and login s...
8
Forum day: API news
1
cbbpproster page replacement?
6
Temporarily Down
2
BBAPI Change Log
13
Data mining and Sweeping
16
Player height value.
6
authorization
2
help with cookies!!!
2
page source code
1
Future Features
15
apostrophe encoded as % in tea...
4
BBAPI released!
82
I need help with XML encoding ...
6
systematic server error on tea...
1
systematic server error on box...
2
BBAPI very slow
22
<
>
Favorite Folders
I need help with XML encoding :(
Set priority
High
Normal
Low
Show messages by
Everybody
LA-Niko (1)
Mod-oeuftete (2)
x_therion_x (3)
Search this Thread (Supporter Feature)
From:
x_therion_x
This Post:
0
83862.1
Date: 3/31/2009 10:36:09 PM
Overall Posts Rated:
0
Hi
I'm relatively (or absolutely) new in development :$, i made this code to download XML info:
-------------
URL pagina = new URL(""http://www2.buzzerbeater.org/BBAPI/countries.aspx"");
URLConnection conexion = pagina.openConnection();
conexion.setRequestProperty("Cookie", cookie);
File escribirestadio = new File(filePaises);
if (!escribirestadio.exists()) {
escribirestadio.createNewFile();
}
InputStreamReader lectorarchivo = new InputStreamReader(conexion.getInputStream(),"utf-8");
BufferedReader lector = new BufferedReader(lectorarchivo);
BufferedWriter escritor = new BufferedWriter(new FileWriter(filePaises));
String linea ;
while (( linea = lector.readLine())!= null) {
System.out.println(linea);
escritor.write(linea);
escritor.newLine();
}
escritor.close();
------------
But, when i open this file i have the next error message in IE:
"An Invalid character was found in text content"
(...)
<country id='78' divisions='3' firstSeason='4' users='42'>
can anybody help me :)?
thank you and excuse me for my english :( xD
Mark Unread
Ignore User
From:
Mod-oeuftete
To:
x_therion_x
This Post:
0
83862.2
in reply to
83862.1
Date: 4/1/2009 3:35:54 PM
Overall Posts Rated:
37
(http://tinyurl.com/clecdp)
BBTools:
(http://bbtools.oeuftete.com/)
GM script:
(http://www.oeuftete.com/static/gm/BuzzerBeater-tweaks.use...)
,
(145219.1)
Mark Unread
Ignore User
From:
x_therion_x
To:
Mod-oeuftete
This Post:
0
83862.3
in reply to
83862.2
Date: 4/1/2009 3:55:01 PM
Overall Posts Rated:
0
pfff why do you don't answer that in the other threads that don't have a really puntual answer? i.e: "
handle the cookies and login stuff in java
"
I already take a look on google and i visited a lot of pages, look at my code.
And respect me, you as GM should made that.
---
I miss this: the temporaly solution that i have is modify the XML part:
<?xml version='1.0' encoding='utf-8'?>
for:
<?xml version = '1.0' encoding ='
iso-8859-1
'?>
but: "Česká Rep" print ?eská Rep, Azərbaycan print: Az?rbaycan (...)
PD: sorry for my english.
Last edited by x_therion_x at 4/1/2009 4:00:38 PM
Mark Unread
Ignore User
From:
Mod-oeuftete
To:
x_therion_x
This Post:
0
83862.4
in reply to
83862.3
Date: 4/1/2009 4:03:45 PM
Overall Posts Rated:
37
I'm sorry, you're right, that was a bit rude.
But general beginning programming problems are probably well outside the scope of this forum, especially for topics as general (and complicated) as XML parsing and the subtleties of encodings.
BBTools:
(http://bbtools.oeuftete.com/)
GM script:
(http://www.oeuftete.com/static/gm/BuzzerBeater-tweaks.use...)
,
(145219.1)
Mark Unread
Ignore User
From:
x_therion_x
To:
Mod-oeuftete
This Post:
0
83862.5
in reply to
83862.4
Date: 4/1/2009 4:08:56 PM
Overall Posts Rated:
0
Allright i got it , thanks, and excuse me for distort the thread.
Then if you wish close this topic and if anybody know what i'm making wrong please PM me, I'll appreciate a lot.
PD: Sorry for my english
Last edited by x_therion_x at 4/1/2009 4:09:12 PM
Mark Unread
Ignore User
From:
LA-Niko
To:
x_therion_x
This Post:
0
83862.6
in reply to
83862.5
Date: 4/4/2009 9:09:59 PM
Overall Posts Rated:
21
Where is the error happening?
I am not familiar with the code you are using but the error looks like something is being returned that probably breaks any encapsulation you have.
For example adding slashes by doing substring replacements to replace ' and " with \' and \" might help.
I can't really see anything about country 78 (Iceland) that is particularly different from the countries previous to it on the list.
You will have to use utf-8 encoding if you want to see all of the characters that make up the country names on BuzzerBeater (same goes for player and team names)
Goodluck
Creator of
(http://www.buzzerbeaterstats.com)
and
(http://www.buzzerbeaternews.com/)
-- Ex GM of Australia -- Division 1 winner of Italy Season 1 then moved team to Australia after the country was created by the BBs. Australian team manager for 2 seasons. Won various tournaments and division 1 titles in the following seasons.
Mark Unread
Ignore User
Disable Emoticons and Images