Forum Moderators: open

Message Too Old, No Replies

Encode & for application/xhtml+xml for non-compliant sites

Google Videos does not support application/xhtml+xml, how to get around it!

         

JAB Creations

1:49 am on Nov 7, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I posted an extremely import video on the news page of my site. However Google Videos does NOT support encoded ampersand which is required when using application/xhtml+xml.

If you wish to create post a link and not compromise the integrity of your coding ethics this is the work around for you!

This requires your webserver to be running Apache.

Find your .htaccess file (if you use FTP and you can not see your .htaccess file you will need to find the place in your FTP to use filters which in this case would be -a to display hidden files).

Inside your .htaccess add this line...

Redirect permanent /redirect/ http://www.example.com/destination&p=1/

The /redirect/ is on your site. If you have www.domain.ant you would simply create a link that looks like...

<a href="http://www.domain.ant/redirect/">example</a>

The user clicks the link, requests the url, Apache sees the redirect, and forwards the user to the destination.

- John

PS - ANT = Antarctica to keep nuetral. ;)

RonPK

5:43 pm on Nov 7, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I don't get it. Are you saying that you can't use a link like
<a href="http##://video.google.com/videoplay?docid=123&amp;sourceid=bar">video</a>
?

JAB Creations

8:59 am on Nov 8, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



No Ron, you must encode ampersands when using XHTML properly. Your link example is not acceptable because it is not ended.

Google video does not work with properly encoded ampersands. Since you must encode ampersands when using application/xhtml+xml this is the only way I could think to resolve the issue in any realistic form.

- John

RonPK

9:45 am on Nov 8, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



John, what would be an acceptable, well-encoded ampersand in your view?

&#x26;
or
&amp;
or
&#38;

They all seem perfectly valid to me.

JAB Creations

3:06 pm on Nov 8, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You're debating with the wrong party. I am simply providing a work around for a problem with Google Video. I am 100% for standards and thus my work around (that can be used until Google fixes their site) allows people to still go by the standards while finding ways around the bugs that exist instead of lowering their standards because of those bugs. It is Google's failure to code their site recognize encoded ampersands.

- John

RonPK

4:32 pm on Nov 8, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm not debating, and IMHO the link example I gave uses a perfectly valid encoded ampersand.

You seem to be overlooking that the syntax of URLs on your site is completely irrelevant to Google Video, or any other site you link to. Their webservers only care about the GET request the user agent sends. After all, it is the user agent that parses the X¦(HT)ML on your page, not Google Video.

Perhaps you could post an example of what you regard a valid link that Google Video does not support. That might clarify things.

[edit: fixed typo]

[edited by: RonPK at 4:33 pm (utc) on Nov. 8, 2006]

encyclo

3:02 am on Nov 9, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I can't see the problem either. I can successfully embed a Google Video on a page served as
application/xhtml+xml
by simply replacing
&
by
&amp;
(as you would expect). My markup looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<embed style="width:400px; height:326px;" id="VideoPlayback" type="application/x-shockwave-flash" src="http://video.google.com/googleplayer.swf?docId=1234567890[b]&amp;[/b]hl=en-CA" flashvars=""> </embed>
</body>
</html>

Tested in Firefox 1.5 (Linux), Page Info confirms the mime type as

application/xhtml+xml
.

JAB Creations

6:13 am on Nov 9, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



My bad, I got it to work though I never saw a mistake in the encoding, Odd.