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

On 6.11.2013 21:28, Simon Pieters wrote:
> Can you please provide real examples where people select attributes in
> JS and would benefit from this proposal? Can you demonstrate that people
> are working around the lack of this feature (e.g. JS frameworks that use
> Selectors with an extension like this)?

Some XML editors use CSS extensively and they extend CSS in order to
provide definition of visual editing mode, e.g.:

http://www.xmlmind.com/xmleditor/_distrib/doc/csssupport/styling_attributes.html

Speaking of JS libraries, isn't jQuery attr() what you are asking for:

http://api.jquery.com/attr/

jQuery has same extensions for Selectors -- some of them are available
just as methods on jQuery object and some of them are also ported
directly to Selectors syntax.

> I understand the ITS use case, but it's not clear to me that ITS is
> something that Selectors should be catering for at this point. I don't
> have anything against ITS per se, but I think it's useful to question if
> it's a need that is relevant for the Web at large or just a niche thing.

From Selectors 4 abstract:

"Selectors are patterns ... that can be used to select nodes in an XML
document."

If Selectors are aiming to be universal selector/query language it
should be possible to select different kinds of nodes in document, not
just elements. Attributes are first candidate to be added, but for the
sake of completeness I think that text and comment nodes should be added
as well, and for XML document also processing instruction nodes.

    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 Wednesday, 6 November 2013 22:57:59 UTC