Re: [selectors4] Proposal for extending Selectors Level 4 with possibility to select attributes

On 5.11.2013 2:30, Tab Atkins Jr. wrote:
> Rather than consuming a new ASCII character, we could just pile this
> onto pseudo-element syntax:
> 
> img::attr(alt)
> 
> ::attr(title)

This would work, but it seems little counter-intuitive as
pseudo-elements until now were defined as elements not represented in
the document tree. So using same mechanism for attributes (which are not
elements) and are presented in the document tree doesn't seem consistent.

If using @ is a real problem another possibility is to extend subject
operator (!) to cover attribute selectors as well, so above queries
could be written as:

img[!alt]

[!title]

But personally I would stick with @ as it's really meme for choosing
attributes.

    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 rep.
------------------------------------------------------------------
    Bringing you XML Prague conference    http://xmlprague.cz
------------------------------------------------------------------

Received on Tuesday, 5 November 2013 08:32:01 UTC