Re: Selecting xml: attributes using CSS attr()

"John P. McCaskey" <[email protected]> Thu, 23 Feb 2017 20:02:15 -0500
Newsgroups gmane.text.tei.general
Message-ID <[email protected]>
Thanks Maarten.

I think I have all the namespaces set correctly and the web server 
configured correctly, serving my document as application/xhtml+xml. 
Namespaces are working just fine on CSS selectors, JavaScript, jQuery in 
all browsers I’ve tried. It’s just attr() on non-Firefox browsers that’s 
not working.

I tried \: and that didn’t work either. If you have a case where it 
works on Chrome on Windows, do let me know.

I submitted an issue report to Google. I’ll watch and see if it shows up 
on the Chromium bug list.

I wonder if there is a JavaScript workaround.

John


On 2/23/2017 5:05 PM, Maarten Janssen wrote:
> The CSS selector for namespaces simply uses a | - but involves a 
> proper definition of the namespace, and requires the document to be 
> served as XHTML, which cannot be done in the document itself but has 
> to be done on the server; in HTML there are no namespaces, so any 
> trick to make them work does not have to be supported by browsers; 
> however, this works in most (the best thing in my experience is to 
> simply avoid namespaces whenever you can):
>
> #item::before { content: attr(namespace\:attribute); }
>
>
> On 23 February 2017 at 22:34, John P. McCaskey 
> <[email protected] <mailto:[email protected]>> wrote:
>
>     The selectors works fine. I see nothing that says attr( ) shouldn’t.
>
>     This looks to me like a bug in the implementation of attr( ) in
>     webkit-rooted browsers (which is virtually everything but
>     Firefox). :-(
>
>     I wonder how to submit a bug report, or even to whom.
>
>     --
>
>
>     On 2/23/2017 8:38 AM, Syd Bauman wrote:
>>>     Have you seen that work?
>>>     It’s not working for me in IE-Edge or in Chrome.
>>     Seehttp://paramedic.wwp.neu.edu/~syd/temp/TEI/tiny_test.xml
>>     <http://paramedic.wwp.neu.edu/%7Esyd/temp/TEI/tiny_test.xml>, which
>>     works for me in Firefox 51.0.1 for Ubuntu, but not in Chromium
>>     55.0.2883.87. (Chromium wants to see "id", not "xml|id".)
>>
>>     If you remember which engines various browsers use (I don't), it may
>>     be helpful to look through
>>     https://en.wikipedia.org/wiki/Comparison_of_layout_engines_(Cascading_Style_Sheets)
>>     <https://en.wikipedia.org/wiki/Comparison_of_layout_engines_%28Cascading_Style_Sheets%29>
>>     for "namespace" and "|".
>