[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Polyglot Markup - serializer questions

  • From: David Carlisle <davidc@nag.co.uk>
  • To: xml-dev@lists.xml.org
  • Date: Thu, 08 Jul 2010 18:12:28 +0100

Re:  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]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.