Page 1 of 1

problem with less attr function and namespace prefixes

Posted: Sat Jan 16, 2016 7:05 pm
by Patrik
Hi,

I just wanted to use the attr function in a less file to output the value of a namespace attribute. Using a css file the same works fine but within a less file I get an error message:
[CSS]:Error: ParseError: Unrecognised input in ... (jar:file:/C:/Program%20Files/Oxygen%20XML%20Editor%2017.1/lib/oxygen.jar!/builtin/js/less/lessc-rhino-1.7.5.js#61)
My css code looks like this:

Code: Select all

@namespace cba "http://www.dita-semia.org/conbat";

*[class~="topic/sl"][cba|prefix]:before(5) {
display : block;
content : attr(cba|prefix);
}
When using the same code in a css file it works fine. The problem is, that I wanted to use variables and, thus, need to use less. Is there any restriction with namespaces in less files I'm not aware of?

Thanks and regards,
Patrik

Re: problem with less attr function and namespace prefixes

Posted: Mon Jan 18, 2016 9:57 am
by Radu
Hi Patrik,

The Javascript LESS compiler we are using:

http://lesscss.org/

has its limitations. We'll look into this though.
It seems that at a first glance you could use quotes around the attribute name like:

Code: Select all

  content: attr("cba|prefix");
Regards,
Radu

Re: problem with less attr function and namespace prefixes

Posted: Mon Jan 18, 2016 6:23 pm
by Patrik
Hi Radu,

using quotes completely solved this problem for me, thanks!

Patrik