homepage Welcome to WebmasterWorld Guest from 23.23.57.144
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / XML Development
Forum Library, Charter, Moderators: httpwebwitch

XML Development Forum

    
Feeding Flash with XML
UTF-8 and beyond
kekko

5+ Year Member



 
Msg#: 3353184 posted 8:13 am on May 30, 2007 (gmt 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"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<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 " />
</player>

Many Thanks

 

cmarshall

WebmasterWorld Senior Member 5+ Year Member



 
Msg#: 3353184 posted 11:45 am on May 30, 2007 (gmt 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">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>
<body>
</body>
</html>

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

Robin_reala

WebmasterWorld Senior Member 10+ Year Member



 
Msg#: 3353184 posted 7:50 pm on Jun 8, 2007 (gmt 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.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / XML Development
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved