XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] Polyglot Markup - serializer questions

On 08/07/2010 17:37, David wrote:
> Thanks to Twitter ( and @xquery ) I stumbled on this
>
> http://www.w3.org/TR/html-polyglot/
>
> I think the goals are excellent, but I do have some questions for 'the
> experts'.
>
> 1) Why is this useful instead of sticking to xhtml ?

A lot of tools produce xhtml but experience shows that many sites 
(including w3c) then serve the resulting file as text/html (partly no 
doubt because IE doesn't really like xhtml much) this works when you are 
lucky but since the file is then parsed by an html parser rather than an 
xml one there is the possibility of getting a completely different parse 
tree than intended. For example if there are scripts using < or more or 
less any use of empty element syntax. The polyglot document tries to 
steer people to safe constructs that will produce more or less the same 
parse tree whether parsed as html or xhtml.


The Abstract says
> "Polyglot markup that meets these constraints as interpreted as
> compatible, regardless of whether they are processed as HTML or as
> XHTML, per the HTML5 specification"
> But I dont quite get why this is necessary ? I'm sure I'm missing the
> obvious, people dont (usually) write specs just for the fun of it.
>
> 2) New XML serializer implementations ?
> The doc discusses the difference between empty tags which are EMPTY vs
> not. E.g. says to use <br/> but not <p/> (instead use <p></p>)
> This would imply (?) that an XML serializer would need to know when its
> OK and not to compress empty tags.

well an xhtm serialiser

> Serializers such as Saxon with html encoding do this but they do it
> differently ... e.g a <br/> in XML becomes <br> in html mode.

It's more like (but different in detail) to xslt 2's xhtml serialisation.

But you can't just meet the constraints by serialisation options, as you 
need to avoid some constructs altogether.

David



________________________________________________________________________
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. 
________________________________________________________________________


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS