Forum Bugs

string-set bug?

randallxski
Is there a known issue with setting multiple variables using string-set within an element? For example, with this code, only the last variable is set. The others are both reset to blank.

chapter{
font-size:11pt;
text-align:justify;
string-set: ch-num attr(number);
line-height:13pt;
string-set: date "12 - 12 - 2012";
string-set: dl-att "12 - 12 - 2012";
}

It's hard to believe that would be broken, but I don't have any better explanations for the behavior I'm seeing.
mikeday
You can only set the property once per element, so you need to set both at the same time, eg. "string-set: str1 val1 str2 val2".
randallxski
Thanks, Mike. It works. That's an implementation I hadn't anticipated.
mikeday
It's a bit odd, but that's the way CSS works: properties can be specified in multiple ways for the same element, eg. with different selectors, and in the end a single property will win the cascade based on its specificity, importance, and order in the style sheet. Most of the time this seems very sensible, as you cannot have two different values for properties like color or font-weight. But for string-set and the counter-increment/reset properties it does feel reasonable to use them twice, so it clashes mental gears a bit.