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

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