Jesper Tverskov | 3 Sep 11:08 2011
Picon

Re: Has HTML5 saved XHTML?

As a follow up to this thread, I have made a tutorial:

"Benefits of polyglot XHTML5",
http://xmlplease.com/xhtml/xhtml5polyglot/

Cheers
Jesper Tverskov
http://www.xmlplease.com

_______________________________________________________________________

XML-DEV is a publicly archived, unmoderated list hosted by OASIS
to support XML implementation and development. To minimize
spam in the archives, you must subscribe before posting.

[Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
Or unsubscribe: xml-dev-unsubscribe <at> lists.xml.org
subscribe: xml-dev-subscribe <at> lists.xml.org
List archive: http://lists.xml.org/archives/xml-dev/
List Guidelines: http://www.oasis-open.org/maillists/guidelines.php

Jesper Tverskov | 3 Sep 11:17 2011
Picon

Benefits of polyglot XHTML5

In order to come to terms with HTML5 and finding out, what happened to
XHTML, I have made a tutorial:

"Benefits of polyglot XHTML5",
http://www.xmlplease.com/xhtml/xhtml5polyglot/

Nice to know if I have forgotten something or if things need to be corrected.

Cheers
Jesper Tverskov
http://www.xmlplease.com

_______________________________________________________________________

XML-DEV is a publicly archived, unmoderated list hosted by OASIS
to support XML implementation and development. To minimize
spam in the archives, you must subscribe before posting.

[Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
Or unsubscribe: xml-dev-unsubscribe <at> lists.xml.org
subscribe: xml-dev-subscribe <at> lists.xml.org
List archive: http://lists.xml.org/archives/xml-dev/
List Guidelines: http://www.oasis-open.org/maillists/guidelines.php

David Carlisle | 5 Sep 02:53 2011
Picon

Re: Benefits of polyglot XHTML5

On 03/09/2011 10:17, Jesper Tverskov wrote:
> In order to come to terms with HTML5 and finding out, what happened
> to XHTML, I have made a tutorial:
>
> "Benefits of polyglot XHTML5",
> http://www.xmlplease.com/xhtml/xhtml5polyglot/
>
> Nice to know if I have forgotten something or if things need to be
> corrected.
>

the snippet:
>
> Since "<" and "&" are common in JavaScripts and must be escaped in
> XML, JavaScripts are often impossible to use inside XML webpages.
>

could be read as saying you can't use inline javascripts in xhtml,
whereas the only restriction is that you can't have them in polyglot as
the escaping rules are different.

text/html
<script> a < B </script>

just needs to be written

<script> a &lt; B </script>

in xml mime types, so inline javascript is certainly possible in xml
webpages.
(Continue reading)

Jesper Tverskov | 5 Sep 10:17 2011
Picon

Re: Benefits of polyglot XHTML5

David Carlisle wrote:

> ..., however more useful in a ployglot context is to not place the
> entire script in a comment but just to place a CDATA section start tag
> in a (javascript) comment and not place the script inside a comment.
> <script>
> \\<![CDATA[
> a < b
> \\]]
> </script>
> works identically in html and xhtml, and is just banned in ployglot as
> the parse tree is not identical, even though the only difference is two
> javascript comments ignored by the javascript processor.

How can you write "however more useful in a polyglot context" and then
end up saying: "and is just banned in polyglot..."?

Does it mean that we should use it in polyglot anyway or what?

Cheers
Jesper Tverskov
http://www.xmlplease.com

_______________________________________________________________________

XML-DEV is a publicly archived, unmoderated list hosted by OASIS
to support XML implementation and development. To minimize
spam in the archives, you must subscribe before posting.

[Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
(Continue reading)

Jesper Tverskov | 5 Sep 10:48 2011
Picon

Re: Benefits of polyglot XHTML5

Also David, please,

Is "--" a bug in the polyglot spec, when it in
http://www.w3.org/TR/html-polyglot/#external-script-and-style, 9.1,
says:

"Polyglot markup uses external scripts if that document's script or
style sheet uses < or & or ]]> or --".

I guess "--" is only disallowed inside XML inside comments in XML?

Cheers
Jesper Tverskov
http://www.xmlplease.com

_______________________________________________________________________

XML-DEV is a publicly archived, unmoderated list hosted by OASIS
to support XML implementation and development. To minimize
spam in the archives, you must subscribe before posting.

[Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
Or unsubscribe: xml-dev-unsubscribe <at> lists.xml.org
subscribe: xml-dev-subscribe <at> lists.xml.org
List archive: http://lists.xml.org/archives/xml-dev/
List Guidelines: http://www.oasis-open.org/maillists/guidelines.php

David Carlisle | 5 Sep 11:04 2011
Picon

Re: Benefits of polyglot XHTML5

On 05/09/2011 09:48, Jesper Tverskov wrote:
> Is "--" a bug in the polyglot spec,

yes, do you want to raise it, or should I ? :-)

David

-- 
google plus: https:/profiles.google.com/d.p.carlisle

________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. 
________________________________________________________________________

_______________________________________________________________________

XML-DEV is a publicly archived, unmoderated list hosted by OASIS
to support XML implementation and development. To minimize
spam in the archives, you must subscribe before posting.

[Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
Or unsubscribe: xml-dev-unsubscribe <at> lists.xml.org
subscribe: xml-dev-subscribe <at> lists.xml.org
List archive: http://lists.xml.org/archives/xml-dev/
List Guidelines: http://www.oasis-open.org/maillists/guidelines.php
(Continue reading)

David Carlisle | 5 Sep 11:11 2011
Picon

Re: Benefits of polyglot XHTML5

On 05/09/2011 09:17, Jesper Tverskov wrote:
> How can you write "however more useful in a polyglot context" and then
> end up saying: "and is just banned in polyglot..."?
>

well by "polyglot context" I meant "situations where you want to serve 
the same file as text/html or application/xhtml+xml and get equivalent 
behaviour., But polygot spec doesn't aim for equivalent behaviour it 
aims for identical DOM, which is harder to achieve.

> Does it mean that we should use it in polyglot anyway or what?

Personally, yes I think it should be allowed, the spec already allows 
some differences from white space parsing in attribute values, and this 
isn't a lot different.

see the comment

http://www.w3.org/Bugs/Public/show_bug.cgi?id=13604#c3

(That bug report is still open)

David
--

-- 
google plus: https:/profiles.google.com/d.p.carlisle

________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.
(Continue reading)

Jesper Tverskov | 5 Sep 13:30 2011
Picon

Re: Benefits of polyglot XHTML5

OK David, you raise the "--" bug.

Cheers
Jesper Tverskov
http://www.xmlplease.com

_______________________________________________________________________

XML-DEV is a publicly archived, unmoderated list hosted by OASIS
to support XML implementation and development. To minimize
spam in the archives, you must subscribe before posting.

[Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
Or unsubscribe: xml-dev-unsubscribe <at> lists.xml.org
subscribe: xml-dev-subscribe <at> lists.xml.org
List archive: http://lists.xml.org/archives/xml-dev/
List Guidelines: http://www.oasis-open.org/maillists/guidelines.php

Jesper Tverskov | 5 Sep 19:14 2011
Picon

Re: Benefits of polyglot XHTML5

I'm not sure I have understood CDATA sections in polyglot XHTML.

In HTML5, "text/html",
http://dev.w3.org/html5/spec/Overview.html#cdata-sections, CDATA
sections can only be used inside foreign content (SVG or MathML). Does
that include internal JavaScripts?

In polyglot XHTML we cannot use escaped "<" and "&" in internal
JavaScript because of a DOM issue (as I have understood it).

When you suggest to use CDATA inside JavaScript in polyglot markup,
having the form:

<script>
\\<![CDATA[
a < b
\\]]>
</script>

it means that we _can_ use not safe content inside a JavaScript if it
is inside a CDATA section in polyglot markup...

What about HTML5 then, saying CDATA sections can only be used in SVG or MathML?

Cheers
Jesper Tverskov
http://www.xmlplease.com

_______________________________________________________________________

(Continue reading)

David Carlisle | 5 Sep 23:20 2011
Picon

Re: Benefits of polyglot XHTML5

On 05/09/2011 18:14, Jesper Tverskov wrote:
> I'm not sure I have understood CDATA sections in polyglot XHTML.
>
> In HTML5, "text/html",
> http://dev.w3.org/html5/spec/Overview.html#cdata-sections, CDATA
> sections can only be used inside foreign content (SVG or MathML). Does
> that include internal JavaScripts?

It;s impossible to have a CDATA section (or any markup) in an html 
script element as it is (in SGML terms) a CDATA element and so  < and & 
lose their normal meaning of starting a markup tag or entity reference 
until </script> is seen.

>
> In polyglot XHTML we cannot use escaped "<" and"&" in internal
> JavaScript because of a DOM issue (as I have understood it).

In xhtml you can have
<script>a &lt; b</script>
in which the text content of the element node is the five characters
"a < b"
which would be seen as that by javascript.

It's not allowed in polyglot as the same thing parsed as text/html would 
produce a text node with 8 characters
"a &lt; b"
and most likely a javascript syntax error.
As Polyglot aims to ensure you get the same DOM from an xml or html 
parse the use of < and & is currently banned.

(Continue reading)


Gmane