problem with less attr function and namespace prefixes

Post here questions and problems related to oXygen frameworks/document types.
Patrik
Posts: 228
Location: Hamburg/Germany

problem with less attr function and namespace prefixes

Sat Jan 16, 2016 7:05 pm

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
Radu
Posts: 5757

Re: problem with less attr function and namespace prefixes

Mon Jan 18, 2016 9:57 am

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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Patrik
Posts: 228
Location: Hamburg/Germany

Re: problem with less attr function and namespace prefixes

Mon Jan 18, 2016 6:23 pm

Hi Radu,

using quotes completely solved this problem for me, thanks!

Patrik

Return to “SDK-API, Frameworks - Document Types”

Who is online

Users browsing this forum: No registered users and 0 guests