Serving XHTML+RDFa as application/xhtml+xml

Dear all,

If this is not an appropriate mailing list for my query below, please
could you direct me to a better list, and accept my apologies for
posting to the wrong place?

The PHP document below produces an error in Firefox and Safari, both
of which - if I'm not mistaken - accept application/XHTML+xml:

<?php header("Content-Type: application/xhtml+xml; charset=utf-8");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; ?>
<!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" xml:lang="en"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.w3.org/1999/xhtml
http://www.w3.org/MarkUp/SCHEMA/xhtml-rdfa-1.xsd"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
    dir="ltr">
    <head>
        <meta http-equiv="Content-Type"
content="application/xhtml+xml; charset=UTF-8" />
        <title>Test</title>
    </head>
    <body>
        <p>Just a test&hellip;</p>
    </body>
</html>

Yet, if I "view source" in those browsers after loading the resulting
page, and paste that source code into the W3C validator, the validator
finds it valid. What, then, am I doing wrong; or is this a bug in
those browsers?*

Many thanks for your help,

Sam

*A few notes:
- If I remove the string "&hellip;", then the page above renders
without error messages, albeit without the ellipsis.
- If I replace the string "&hellip;" with an ellipsis character
(copied from Wikipedia, for instance, and pasted into the PHP code),
then the page renders without error messages and with the ellipsis.
This would be a fine solution if it weren't for the fact that other
people who I'm working with may want to be able to enter such
characters as HTML entity references such as "&hellip;". So I need to
be able to achieve a result that will allow them to do so.
- If I replace the string "application/xhtml+xml" in the first line
with "text/html", then the page renders without error messages and
with the ellipsis. For the time being, this is the solution I've
adopted, but for browsers that support application/xhtml+xml, I'd
rather serve application/xhtml+xml, as this specified as a SHOULD in
http://www.w3.org/TR/rdfa-syntax/ (unless I've misunderstood).

Received on Tuesday, 27 January 2009 17:10:52 UTC