Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

Feeding Flash with XML

UTF-8 and beyond

8:13 am on May 30, 2007 (gmt 0)

New User

10+ Year Member

joined:May 27, 2006
votes: 0

Hi all,
i wonder how can i get my file to be utf-8 and xml compliant.
I've tried some validators, but they gives different errors, so i'm a bit confused.
At the moment this xml feed my mp3 player with path for mp3s but it stops every time there's a strange char (like ' " )in the song title.
In the example below the first song don't work, the second does.

I've been told that the secret lies in having the file to be completely UTF-8 compliant, but then again, i'm not sure how.

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<player autoStart="yes" productId="78" cPath="" artist_id="68" keywords="" bpm_id="" categories_id="" vocals_id="" mood_id="" page_name="index.php">
<song path="stream_song.php?song=download/La_Belle_Alliance/Lost_Recreation/hifi/04 - Test Artist - Don't Put Me Under Pressure.mp3" title="04 - Test Artist - Don't Put Me Under Pressure " />
<song path="stream_song.php?song=download/La_Belle_Alliance/Lost_Recreation/hifi/05 - Test Artist - The Ladders To Heaven.mp3" title="05 - Test Artist - The Ladders To Heaven " />

Many Thanks

11:45 am on May 30, 2007 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Feb 21, 2005
votes: 0

Welcome to WebmasterWorld!

Well, the example you give is not XHTML 1.0 compliant, because it has no <html><head></head><body></body></html> structure. These are necessary for a full XHTML-compliant file.

The character set should be given in a meta http-equiv element.

Here is the basic structure of an XHTML 1.0 Transitional file. Note that the XML preamble is omitted. This is because some browsers can't deal with it:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<meta http-equiv="content-type" content="text/html; charset=utf-8" />

Also, if you want to exude XHTML, you can't use the <song> element. You need to convert it to XHTML-acceptable elements like <div> or <ul>.

7:50 pm on June 8, 2007 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 26, 2004
votes: 0

I think the OP actually wants to produce XML, not XHTML. In that case you'd need to dump the DOCTYPE (which refers to the vocabulary an XHTML document should conform to). You also don't need to validate - your document should of course be well formed, but it can't be validated as you're not providing a schema to validate it against.

If you really are having UTF-8 problems then how are you generating the file? If you're hand coding it then you need to make sure that your editor is saving it in UTF-8 format.