![]() |
|
|||||||
| Register | FAQ | Members List | Arcade | Dev Directory | HB Bank | Calendar | Search | Today's Posts | Mark Forums Read |
| Webmaster Discussion This is a general webmaster disussion board! No Advertising Allowed! |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
New Hunter
|
On 16 October 2008 the W3C announced XHTML+RDFa as a recommendation. IMO this is an important milestone in the process of implementing the Semantic Web. The Doctype/DTD is now cataloged and usable by the W3C Markup Validator.
By way of example of the use of basic constructs and syntax, I have composed a validated XHTML+RDFa page -- just general information for those who might be interested in the development of the Semantic Web. James
__________________
XHTML 1.0 (strict) page - table free -- fluid three column layout Serving XHTML - content negotiation/selected content (MIME) type All pages Interoperable and with Validated Markup/CSS |
|
|
|
|
|
#2 (permalink) |
|
Senior Staff
|
I have been following this a bit as well.
This new system will make older sites that have outdated coding become up to date with very little work. There are a lot of sites out there that would like to enjoy the modern reading of their code but they do not have the option to change or update their script but this will change that. There are also some downfalls that I can see from this but we will see here very soon what the effects and possibilities are going to be. Good post!
__________________
l GuideHunters.com l Devhunters.net Directory l Web Directory l Be a star in The DevHunters Directory |
|
|
|
|
|
#3 (permalink) | |
|
New Hunter
|
Quote:
Hunter, reading the post I thought straight away to modify my site's markup to XHTML+RDFa. Wouldn't that be a good idea? Which are the downfalls? |
|
|
|
|
|
|
#4 (permalink) | |
|
New Hunter
|
Thanks, Webnauts.
Quote:
James
__________________
XHTML 1.0 (strict) page - table free -- fluid three column layout Serving XHTML - content negotiation/selected content (MIME) type All pages Interoperable and with Validated Markup/CSS |
|
|
|
|
|
|
#5 (permalink) |
|
New Hunter
|
BTW, if you would like to see Triples and Graphs (and source code) used in conjunction with RDF/XML (referenced in the W3C XHTML+RDF link in my previous post) depicted go to this W3C Validation result
James
__________________
XHTML 1.0 (strict) page - table free -- fluid three column layout Serving XHTML - content negotiation/selected content (MIME) type All pages Interoperable and with Validated Markup/CSS |
|
|
|
|
|
#6 (permalink) |
|
New Hunter
|
James I think I was too quick. I began implementing it on my web site.
I know I have to read the documentation and implement several stuff, but for a start I just added on my all my pages the following PHP script, taking care of the HTML (ascii) codes of my pages: <?php $charset = "utf-8"; $mime = "text/html"; function fix_code($buffer) { return (str_replace(" />", ">", $buffer)); } if(stristr($_SERVER["HTTP_ACCEPT"],"application/xhtml+xml")) { # if there's a Q value for "application/xhtml+xml" then also # retrieve the Q value for "text/html" if(preg_match("/application\/xhtml\+xml;q=0(\.[1-9]+)/i", $_SERVER["HTTP_ACCEPT"], $matches)) { $xhtml_q = $matches[1]; if(preg_match("/text\/html;q=0(\.[1-9]+)/i", $_SERVER["HTTP_ACCEPT"], $matches)) { $html_q = $matches[1]; # if the Q value for XHTML is greater than or equal to that # for HTML then use the "application/xhtml+xml" mimetype if($xhtml_q >= $html_q) { $mime = "application/xhtml+xml"; } } # if there was no Q value, then just use the # "application/xhtml+xml" mimetype } else { $mime = "application/xhtml+xml"; } } # special check for the W3C_Validator if (stristr($_SERVER["HTTP_USER_AGENT"],"W3C_Validator")) { $mime = "application/xhtml+xml"; } # set the prolog_type according to the mime type which was determined if($mime == "application/xhtml+xml") { $prolog_type = "<?xml version='1.0' encoding='$charset'?> <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML+RDFa 1.0//EN' 'http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd'> <html xmlns='http://www.w3.org/1999/xhtml' version='XHTML+RDFa 1.0' xml:lang='en'>"; } else { ob_start("fix_code"); $prolog_type = "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'> <html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>"; } # finally, output the mime type and prolog type header("Content-Type: $mime;charset=$charset"); header("Vary: Accept"); print $prolog_type; ?> I tested already with diverse browsers and I have not noticed any compatibility issues. Do you think that what I am doing would harm in any way?
__________________
SEO Workers - Search Engine Analysts & Optimization Experts |
|
|
|
|
|
#7 (permalink) | |
|
New Hunter
|
Quote:
(Of course you don't have any RDFa syntax added yet) James
__________________
XHTML 1.0 (strict) page - table free -- fluid three column layout Serving XHTML - content negotiation/selected content (MIME) type All pages Interoperable and with Validated Markup/CSS Last edited by jamesicus; 10-25-2008 at 08:01 PM. Reason: added forgotten text |
|
|
|
|
|
|
#8 (permalink) |
|
New Hunter
|
Great!
You are right. That is the next step. Thanks, John :)
__________________
SEO Workers - Search Engine Analysts & Optimization Experts |
|
|
|
|
|
#9 (permalink) |
|
New Hunter
|
James I have a question. I do not use for my "h1" tags the "title" tags content.
I have for example the title "SEO Workers - Search Engine Optimization Consulting Company" and for the h1 tag "SEO & Custom Web Design Experts for Better Search Engine Rankings" Since I wanted to add a property to my h1 tag, I guess I need to add a meta tag for s dc.title. What should I use there for the property? The content of my "title" or of the "h1" tag?
__________________
SEO Workers - Search Engine Analysts & Optimization Experts |
|
|
|
|
|
#10 (permalink) | |
|
New Hunter
|
Quote:
James
__________________
XHTML 1.0 (strict) page - table free -- fluid three column layout Serving XHTML - content negotiation/selected content (MIME) type All pages Interoperable and with Validated Markup/CSS |
|
|
|
|
|
|
#11 (permalink) |
|
New Hunter
|
I checked Dublin core. Thanks James.
I guess I have one very last question that is giving me a headache: http://www.w3.org/2005/08/online_xsl...eoworkers.com/ I get an error: unparseable - text/plain not visibly XML. Can you tell what that can be?
__________________
SEO Workers - Search Engine Analysts & Optimization Experts |
|
|
|
|
|
#12 (permalink) |
|
New Hunter
|
Do you think you can help me with a php script, since I can't get mine working properly?
__________________
SEO Workers - Search Engine Analysts & Optimization Experts |
|
|
|
|
|
#13 (permalink) |
|
New Hunter
|
Sorry I didn't get back to you sooner, Webnauts. I will have to study your page further.
Webnauts and Hunter1: Thanks. I composed this page to illustrate the use of the XHTML+RDFa Doctype/DTD, and the syntax of three primary RDFa elements: | about | property | typeof | together with an example FOAF (Friend Of A Friend) and Creative Commons constructs -- for those who might want to experiment with creating XHTML+RDFa pages after reading the W3C RDFa Primer and RDFa recommendation RDFa in XHTML: Syntax and Processing. This is actually my own attempt to understand how XHTML+RDFa documents are constructed and function. James
__________________
XHTML 1.0 (strict) page - table free -- fluid three column layout Serving XHTML - content negotiation/selected content (MIME) type All pages Interoperable and with Validated Markup/CSS |
|
|
|
|
|
#14 (permalink) | |
|
New Hunter
|
Quote:
I switched back to XHMTL Strict because I could not get my PHP parser working correctly. If I had an appropriate functional parser, I would not have had to change back. I know already the above you have mentioned FOAF, etc). Do you think you could share the parser script? I would even pay a fee. Thanks a lot in advance, John
__________________
SEO Workers - Search Engine Analysts & Optimization Experts |
|
|
|
|
|
|
#15 (permalink) | |
|
New Hunter
|
Quote:
James
__________________
XHTML 1.0 (strict) page - table free -- fluid three column layout Serving XHTML - content negotiation/selected content (MIME) type All pages Interoperable and with Validated Markup/CSS |
|
|
|
|
|
|
#16 (permalink) |
|
New Hunter
|
The PHP script I am about is for serving up XHTML with the correct MIME type, and being cross browser compatible.
This one did not do the work as it should so far : <?php $charset = "utf-8"; $mime = "text/html;"; function fix_code($buffer) { return (str_replace(" />", ">", $buffer)); } if(stristr($_SERVER["HTTP_ACCEPT"],"application/xhtml+xml")) { # if there's a Q value for "application/xhtml+xml" then also # retrieve the Q value for "text/html" if(preg_match("/application\/xhtml\+xml;q=0(\.[1-9]+)/i", $_SERVER["HTTP_ACCEPT"], $matches)) { $xhtml_q = $matches[1]; if(preg_match("/text\/html;q=0(\.[1-9]+)/i", $_SERVER["HTTP_ACCEPT"], $matches)) { $html_q = $matches[1]; # if the Q value for XHTML is greater than or equal to that # for HTML then use the "application/xhtml+xml" mimetype if($xhtml_q >= $html_q) { $mime = "application/xhtml+xml"; } } # if there was no Q value, then just use the # "application/xhtml+xml" mimetype } else { $mime = "application/xhtml+xml"; } } # special check for the W3C_Validator if (stristr($_SERVER["HTTP_USER_AGENT"],"W3C_Validator")) { $mime = "application/xhtml+xml"; } # set the prolog_type according to the mime type which was determined if($mime == "application/xhtml+xml") { $prolog_type = "<?xml version=\"1.0\" encoding=\"$charset\"?> <?xml-stylesheet type=\"text/xsl\" href=\"/copy.xsl\"?> <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML+RDFa 1.0//EN' 'http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd'> <html xmlns='http://www.w3.org/1999/xhtml' version='XHTML+RDFa 1.0' xml:lang='en'>"; } else { ob_start("fix_code"); $prolog_type = "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'> <html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>"; } # finally, output the mime type and prolog type header("Content-Type: $mime;charset=$charset"); header("Vary: Negotiate,Accept,"); print $prolog_type; ?> I am sure you are using a script for that. Do you understand what I mean? Thanks James. :)
__________________
SEO Workers - Search Engine Analysts & Optimization Experts Last edited by Webnauts; 11-04-2008 at 12:25 AM. |
|
|
|
|
|
#17 (permalink) | |
|
New Hunter
|
Quote:
<?php # For MSIE browsers if (stristr($_SERVER["HTTP_USER_AGENT"],"MSIE")) { $mime = "text/html"; $charset = "utf-8"; $prolog_type = " <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML+RDFa 1.0//EN' 'http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd'> <html xmlns='http://www.w3.org/1999/xhtml' version='XHTML+RDFa 1.0' xml:lang='en'>"; } # For other browsers else { $mime = "application/xhtml+xml"; $charset = "utf-8"; $prolog_type = "<?xml version='1.0' encoding='$charset'?> <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML+RDFa 1.0//EN' 'http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd'> <html xmlns='http://www.w3.org/1999/xhtml' version='XHTML+RDFa 1.0' xml:lang='en'>"; } # Generate the mime type and prolog type header("Content-Type: $mime; charset=$charset"); header("Vary: Negotiate, Accept"); print $prolog_type; ?>
__________________
XHTML 1.0 (strict) page - table free -- fluid three column layout Serving XHTML - content negotiation/selected content (MIME) type All pages Interoperable and with Validated Markup/CSS |
|
|
|
|
|
|
#18 (permalink) |
|
New Hunter
|
John -- or for serving XHTML 1.0 (strict) via content-negotiation:
<?php # For MSIE browsers if (stristr($_SERVER["HTTP_USER_AGENT"],"MSIE")) { $mime = "text/html"; $charset = "utf-8"; $prolog_type = "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'> <html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en-us' lang='en-us'>"; } # For other browsers else { $mime = "application/xhtml+xml"; $charset = "utf-8"; $prolog_type = "<?xml version='1.0' encoding='$charset'?> <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'> <html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en-us' lang='en-us'>"; } # Generate the mime type and prolog type header("Content-Type: $mime; charset=$charset"); header("Vary: Negotiate, Accept"); print $prolog_type; ?>
__________________
XHTML 1.0 (strict) page - table free -- fluid three column layout Serving XHTML - content negotiation/selected content (MIME) type All pages Interoperable and with Validated Markup/CSS |
|
|
|
|
|
#19 (permalink) |
|
New Hunter
|
James did anybody ever tell you that you RULE? I assume yes.
But just in case I am wrong, then I must admit that you rule! Thank you so much for the excellent support! I implemented a test page and it works great! Please PM me your paypal. I would love to buy you a beer. Or anything else you wish. :)
__________________
SEO Workers - Search Engine Analysts & Optimization Experts |
|
|
|
|
|
#20 (permalink) | |
|
New Hunter
|
I will read this to my wife and cat -- they don't understand that! :)
Quote:
Use Web-Sniffer View HTTP Request and Response Header to check how your pages are being served -- just specify the User-Agent (Browser) you wish to check for and leave everything else at default. Among other things, the content (MIME) type and character encoding will be displayed along with the page source code. James
__________________
XHTML 1.0 (strict) page - table free -- fluid three column layout Serving XHTML - content negotiation/selected content (MIME) type All pages Interoperable and with Validated Markup/CSS |
|
|
|
|