Re: [selectors-nonelement] ::attr(*|localname), ::attr(ns|*), and ::attr(*)

On 24.2.2014 14:01, Simon Pieters wrote:
> I'm not Tab but I think the reasoning is as follows:
> 
> * and foo are equivalent for the namespace part, i.e. same as *|* and
> *|foo or ns|* and ns|foo
> 
> hence
> 
> ::attr(*) and ::attr(foo) should also be equivalent for the namespace
> part, i.e. same as ::attr(|*) and ::attr(|foo)

Aha, so it seems that the following text is ambiguous:

"If the prefix is omitted, the selector only matches attributes in no
namespace."

because it is not clear whether prefix means "ns" or "ns|". Then
rewriting grammar into more rules could help:

 <namespace-attr> = [ <prefix>? '|' ]? [ <ident> | '*' ]
 <prefix>         = [ <ident> | '*' ]

Now it is clear that prefix is meant without | and  thus ::attr(foo) and
::attr(|foo) are different -- former select all foo attributes in any
(including no) namespace and later only in no namespace.

Which I think is behaviour user would expect and it is consistent with
differences when applying default namespace to elements and 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 Monday, 24 February 2014 13:33:08 UTC