Bad token error in stylesheets

This forum is for all Flare issues related to styles, stylesheets and XML.
Post Reply
nick777
Propeller Head
Posts: 20
Joined: Mon Jan 14, 2008 9:02 am

Bad token error in stylesheets

Post by nick777 »

When I build a project, I get errors on both of the stylesheets I'm using:
Line 893 Char 6. Bad token in selector: |
Line 494 Char 6. Bad token in selector: |

What does this mean, and more importantly, how can I fix it? My CHM files that I generate look fine when I look at them on my machine, but when I transfer them to another machine, the fonts are broken.
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Bad token error in stylesheets

Post by LTinker68 »

Open your stylesheet in the Internal Text Editor and search in that document for the pipe character (|). You might have specified it as the separator in the breadcrumbs or as a character in an auto-number style or maybe it's in a complex selector. If you're using it in the breadcrumbs or in an auto-number style, then make sure the pipe character is surrounded by quote marks in the stylesheet. If you're using it in a complex selector, then it may not be a valid character for complex selectors (I don't know if it is or not).
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
nick777
Propeller Head
Posts: 20
Joined: Mon Jan 14, 2008 9:02 am

Re: Bad token error in stylesheets

Post by nick777 »

Well, I used the internal text editor and just replaced the | with _. That seemed to remove the errors I was receiving upon building. Thing is, Analyzer put those | in there when I set it to convert some items into styles. So, Analyzer creates this problem, and Flare doesn't like it.
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: Bad token error in stylesheets

Post by LTinker68 »

Interesting. Make sure you submit that in a bug report to MadCap (http://www.madcapsoftware.com/bugs/submit.aspx). Report it for both Flare and Analyzer.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
kerimucci
Propeller Head
Posts: 59
Joined: Thu Nov 02, 2017 3:38 am

Re: Bad token error in stylesheets

Post by kerimucci »

Hi guys,

I am getting a similar error: CSS Parser: C:\Users\Keri\Documents\My Projects\Jazz\Content\API Developer Guide\Methods\Paths.html Line: 320. Char: 16. Bad token in selector: &

What I am trying to do right now is use an imported HTML file of our API spec (generated from Swagger), and link to it as a source file. The end goal is to manage the content in Flare like I do all other docs, but have this one automatically update when Engineering updates the source file. I made a copy of my existing CSS and renamed it to use the same filename as the one used in Swagger. However, I want the content to use my classes.

I checked both my CSS and the imported HTML file and line 320 does not have a '&' character, so I have no idea what is causing the error. The error seems to be indicating the problem lies in the source file ("Paths.html"), rather than the CSS. Can anyone shed any light?
SteveS
Senior Propellus Maximus
Posts: 2089
Joined: Tue Mar 07, 2006 5:06 pm
Location: Adelaide, far side of the world ( 34°56'0.78\"S 138°46'44.28\"E).
Contact:

Re: Bad token error in stylesheets

Post by SteveS »

The line the parser refers to is not the line in a text editor but rather the line of actual code.

The error sounds as if there is a missing ; or closing tag. Either that or you are use an ampersand as a selector, &{ }, which should be easy to find.

HTH
Image
Steve
Life's too short for bad coffee, bad chocolate, and bad red wine.
Post Reply