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

On 17.2.2014 19:30, Andrew Fedoniouk wrote:
> If your goal is to extend core of CSS selectors for one particular
> use case/application then that's one story (A).

No, this is not the case. Please go through the minutes from discussion
we had Shenzen at WG meeting. To summarize it, Selectors try to be
generic document query language (it has been separated into its own
spec, it is no longer used only in CSS, ...), yet lack many of features.
The biggest problem is that they aren't closed over data model and are
not able to return other parts of document then elements.

Support for attributes are the first step in this direction.

> If the goal is to provide XPath alternative based on CSS selectors
> grammar then this is another story (B).

Selectors will never match XPath in functionality, but they need to be
at least slightly improved to cover new demands.

> In this case the specification even at this stage should contain
> at least notions of the following:
> 1. selection of one or several attribute nodes.
> 2. selection of --"-- text nodes.
> 3. selection of --"-- comment nodes.

That's the plan, read the note in the draft:

"Note: Currently the draft only defines means for selecting and matching
attribute nodes, but other kinds of nodes, such as comments or
processing instructions, might be supported in the future."

But it was agreed in Shenzen that I should produce draft with support
for attributes. We will see how it goes and support for other kind of
nodes might be added later.

Adding other kind of nodes however will require more housekeeping. For
example current data model for Selectors
( contains only
elements and attributes, other kinds of nodes are not inside it.

> My pardon but as for now the spec looks like an attempt
> to solve (A) task for one particular use case - selecting single attribute.

You can select all attributes by ::attr(*)

  Jirka Kosek      e-mail:
       Professional XML consulting and training services
  DocBook customization, custom XSLT/XSL-FO document processing
 OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 rep.
    Bringing you XML Prague conference

Received on Tuesday, 18 February 2014 09:31:18 UTC