W3C home > Mailing lists > Public > www-style@w3.org > February 2014

Re: [selectors-nonelement] First draft of a new spec for selecting non-element nodes

From: Andrew Fedoniouk <news@terrainformatica.com>
Date: Sun, 16 Feb 2014 11:32:11 -0800
Message-ID: <CALRQH79o6vJS3HDOb1sgPVOb4-7NEGbQE2GbyNszsq+f5K7UGA@mail.gmail.com>
To: Jirka Kosek <jirka@kosek.cz>
Cc: Brad Kemper <brad.kemper@gmail.com>, "Tab Atkins Jr." <jackalmage@gmail.com>, Daniel Glazman <daniel.glazman@disruptive-innovations.com>, www-style list <www-style@w3.org>
On Sun, Feb 16, 2014 at 12:42 AM, Jirka Kosek <jirka@kosek.cz> wrote:
> On 16.2.2014 5:47, Andrew Fedoniouk wrote:
>> If someone need to select attributes (why not text/comment nodes
>> too by the way?) then it is matter of writing trivial functions like:
>> document.queryAttribute = function(elselector,attribute) { .. }
>
> Use-case for attribute node selector needs ability to select attributes
> using selectors syntax without escaping to API of some programming language.
>

My pardon, but what exactly is that use-case?

Is it this one:

 <translateRule selector="abbr::attr(title)" translate="no"/>

? If "yes" then what conceptually stops you from either this

 <translateRule selector="abbr" attr="title" translate="no"/>

or this custom form:

<translateRule selector="abbr{title}" translate="no"/>

'{' will never be part of selectors so you can safely use it
as a delimiter in domain specific query language that
includes CSS selectors as a subset of its grammar.


-- 
Andrew Fedoniouk.

http://terrainformatica.com
Received on Sunday, 16 February 2014 19:32:39 UTC

This archive was generated by hypermail 2.3.1 : Sunday, 16 February 2014 19:32:42 UTC