- From: Jirka Kosek <jirka@kosek.cz>
- Date: Mon, 14 May 2012 10:02:35 +0200
- To: MultilingualWeb-LT Working Group <public-multilingualweb-lt@w3.org>
- CC: MultilingualWeb-LT Working Group Issue Tracker <sysbot+tracker@w3.org>
- Message-ID: <4FB0BC1B.4090804@kosek.cz>
On 14.5.2012 9:46, MultilingualWeb-LT Working Group Issue Tracker wrote: > SOLUTION A) > One solution would be: not specifying a mechanism at all, but a link to external rules in the <head> element and a processing chain: > 1) convert the HTML5 to an XML serialization (XHTML5) > 2) do the ITS processing (defaults, globally, locally) > 3) convert the result in the original serialization from 1) > Drawback: we require XML processing and knowledge of XPath from users and implementors. That might hinder the adoption of ITS. Hi, actually there is no need to go back and forth between HTML and XML serialization. Result of HTML5 parsing algorithm is DOM where all HTML elements are in XHTML namespace. HTML5 specification then even slightly changes XPath 1.0 spec in order to make writing XPath queries easier (not dealing with namespaces), see http://www.w3.org/TR/html5/apis-in-html-documents.html#interactions-with-xpath-and-xslt So to sum up -- there is no need for XML processing. All current browsers are able to perform XPath over DOM constructed from parsing HTML page. XPath is quite easy when you just select elements/attributes with occasional primitive conditions. > SOLUTION B) > We develop a different mechanism for global selection, e.g. relying on CSS selectors. CSS selectors are well known among web developers and related implementors, so adoption might be easier. > Drawback: we need to involve the right people in that mechanism and would have probably two mechanisms in place: the CSS selectors based one and the XPath one for people who want to process XML (still in scope as *one part* for ITS 2.0). CSS selectors are unusable for ITS. Overall they are very poor selection mechanism compared to XPath. The biggest limitation is that CSS selector can't match attribute node and given number of HTML attributes which can contain natural text attributes are very likely target of ITS rules for HTML documents. So I would suggest relying on XPath only. We can say that if ITS rules are linked from HTML document (not XML or XHTML) speacial XPath rules stated in the link above apply as well. Jirka -- ------------------------------------------------------------------ Jirka Kosek e-mail: jirka@kosek.cz http://xmlguru.cz ------------------------------------------------------------------ Professional XML consulting and training services DocBook customization, custom XSLT/XSL-FO document processing ------------------------------------------------------------------ OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 member ------------------------------------------------------------------
Received on Monday, 14 May 2012 08:03:14 UTC