[Bug 12792] Publish the polyglot 'Sample Page' as both 'application/xhtml+xml' and as 'text/html'

http://www.w3.org/Bugs/Public/show_bug.cgi?id=12792

Leif Halvard Silli <xn--mlform-iua@xn--mlform-iua.no> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|WORKSFORME                  |
            Summary|Publish the polyglot        |Publish the polyglot
                   |'Sample Page' as            |'Sample Page' as both
                   |'application/xhtml+xml'     |'application/xhtml+xml' and
                   |                            |as 'text/html'

--- Comment #7 from Leif Halvard Silli <xn--mlform-iua@xn--mlform-iua.no> 2011-08-25 00:15:17 UTC ---
(In reply to comment #6)
> SVG in the polyglot sample page [1] renders beautifully in Safari 5.1 (7534.50),

Back then it did not work. And it still does not workin Opera ... However, I
understand that my focus on browser compatibility and browser tricks (such as
content-negotiation, which could also have been an option) will not bring us
forward. I will save the subject of browser hacks and browser tricks to another
occassion ...  Thus, let me instead focus more strictly on making the
SamplePage demonstrate the featurs of Polyglot Markup.

Because, as is, served as text/html and only as text/html, I don't feel that it
demonstrates polyglot markup in any significant way - except, on the coding
level. To really demonstrate that it is polyglot markup, the page be presented
once as XML and once as HTML.

HENCE: Couldn't you just publish the document as both XML and as HTML - two
copies of same document, to demonstrate that that the page not only validates
as XHTML and HTML but also can be consumed as both XHTML and XML?  You could
then change the following text:

]] You can view the page live at
http://dev.w3.org/html5/html-xhtml-author-guide/SamplePage.html. [[

in to this:

]] You can view the page live, served as text/html, at
http://dev.w3.org/html5/html-xhtml-author-guide/SamplePage-as-HTML. And served
as application/xhtml+xml at
http://dev.w3.org/html5/html-xhtml-author-guide/SamplePage-as-XML. [[

I note, btw, that the sentence before the above quote, contains a link from
'polyglot markup' to a section
(http://www.w3.org/TR/html-polyglot/#dfn-polyglot-markup)  which defines what
polyglot markup by pointing out that it can be served as either HTML or as XML:

]] Polyglot markup is [ … snip … ]. It is recommended that these documents be
served as either text/html (if the content is transmitted to an HTML-aware user
agent) or application/xhtml+xml (if the content is transmitted to an
XHTML-aware user agent). [[

PS: You could of course keep two copies of the same document. But in case you
are afraid that the two could get out of sync, you could e.g. use Server Side
Includes to publish a duplicate. This is simplest if you create an XML copy
first, and the use aServer Side Include file to publish a HTML version:

1) * Create 'SamplePage-as-XML.xhtml' - the same file as now, 
       but with a new name and with the '.xhtml' as suffix.
    * You do not need to include '.xhtml' in the public link,
       you can instead use a 'cool URI' to  'SamplePage-as-XML'  
       without suffix (because W3.org supports content negotiation, 
       so you don't ned to show the suffix to the public.)
2) * Create 'SamplePage-as-HTML.shtml' - this page should
       only contain the following string: 
       <!--#include virtual="SamplePage-as-XML" -->
     * Refer to this page with a cool URI to 'SamplePage-as-HTML'

Voila. You can now update the XML version, and it will be reflected in the
.shtml version.

-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Thursday, 25 August 2011 00:15:20 UTC