Hassles with context rules

Steve Rickaby srickaby at wordmongers.demon.co.uk
Fri Jan 6 05:29:10 PST 2006


Hi People

I'm having problems with context rules not being executed as expected. I'm probably doing something obviously wrong, but it's not obvious to me.

I have the following rule, which is incomplete at present:

>Element (Container): TitleBody
>General rule:	<TEXT>, IndexTerm?
>Text format rules
>Count ancestors named:	Section
>	If level is: 3
>		Use paragraph format: C-head
>	Else, if level is: 2
>		Use paragraph format: B-head
>	Else, if level is: 1
>		If context is: Title < SectionProgramming
>			Use paragraph format: A-headExercises
>		Else, if context is: Title < SectionReview
>			Use paragraph format: A-headReview
>		Else
>			Use paragraph format: A-head
>	Else
>		If context is: Title < Chapter
>			Use paragraph format: ChapterTitle

TitleBody is part of Title, hence the 'parent < parent' terms. 'SectionProgramming' and 'SectionReview' are special sections with a different structure and visual design. The purpose of the rule is to correctly format titles wherever they occur, and this is both level and section-type dependent.

The level-dependent parts of this rule are working fine, but the context subrule is failing the tests for the elements 'SectionProgramming' and 'SectionReview' - but working for the 'else ... Use paragraph format: A-head' parts. Thus the paragraph format is not applied correct only for these two special section types, and the titles for these sections end up with the default 'body' para format.

What am I doing wrong? Is this some sort of rule nesting problem?
-- 
Steve



More information about the framers mailing list