Skip to main content
Known Participant
August 8, 2011
Answered

EDD Context Rules for a parent element possible?

  • August 8, 2011
  • 1 reply
  • 2539 views

Hi all,

I understand the use of {first} when identifying the context of an element, such as:

If context is: {first}<Section

But what if I want to set whether Section is first inside its parent?

For instance, for this hierarchy:

<chapter>

  <section></title></section>

  <section></title></section>

</chapter>

I want to say that if <title> appears in the first <section> element within a <chapter>,  then apply a particular format.  Otherwise, apply a different format if <title> appears in a <section> that is not first within a <chapter>. -- i.e. a parent element context, if you will.

The syntax to do this is eluding me.  My EDD has a series of context rules for a <title>, including for when it appears within a <section>, like this:

Else, if context is: Section < Chapter
     If context is: <{first}<Chapter
        Use paragraph format: Heading1NoNewPage
     Else
        Use paragraph format: Heading1

Whatever syntax I try for the context rule above (that the section be first within the chapter), I get parsing errors or the rule is not read.  I've tried:


If context is: Section<Chapter{first}

If context is: <{first}<Chapter                   // invalid

If context is: Section{first}<Chapter          // applies only Heading1; never reads this

If context is: Section < {first} Chapter       // invalid

Any ideas if there is a syntax that allows you to set a context for  the parent element, and not just for the element in question?

Thanks for anyone's help on this.

Shelley

Shelley Hoose

Rogue Wave Software

Senior Documentation Developer

This topic has been closed for replies.
Correct answer Lynne A. Price

Shelley,

  Remember that

     Section{first} < Chapter

does not test whether the current element is in the first Section in a Chapter. Rather, it tests whether the current element is in a Section that is the first child of a Chapter. Thus, if your Chapter begins with a title, or has any introductory paragraphs, lists, or so on, the rule will not apply. (Allowing FrameMaker to test for more complete sibling relationships could make editing prohibitively slow.)

If your chapters do have material preceding the first section, you need to use a context such as:

    Section{after Title} < Chapter

     --Lynne

1 reply

Inspiring
August 8, 2011

Shelley,

  The context specification:

    Section{first} < Chapter

tests whether the current element (such as Title) is in a Section that is the first child of a Chapter;

   {first} < Section{first} < Chapter

tests whether the current element is the first child of a Section that itself is the first child of a Chapter.

     --Lynne

P.S. Remember that element names are case-sensitive.

shooseAuthor
Known Participant
August 9, 2011

Lynne, thanks.

So at least I know I have the syntax correct, but somehow the order/logic is wrong, because I cannot get Frame to read the second if/else statement.

Here's what I have:

Else, if context is: Section < Section < Chapter            //this works fine; i'm just including it here for context.
Use paragraph format: Heading2

Else, if context is: Section < Chapter
Use paragraph format: Heading1


Else, if context is: Section{first} < Chapter
Use paragraph format: Heading1NoNewPage

The first else/if is being applied, but the second one is not, i.e. all are getting a Heading1.  I have tried switching them, and then neither gets read, i.e. no Heading1 level style is applied at all.

I can do a nested rule instead, but this skips over the "if" and does not apply the Heading1NoNewPage style, applying only Heading1.

Else, if context is: Section < Section < Chapter
Use paragraph format: Heading2


Else, if context is: Section < Chapter
   If context is: Section{first}
       Use paragraph format: Heading1NoNewPage
  Else
       Use paragraph format: Heading1

Clearly the logic/order are faulty, but I cannot tell how.

Thanks for any help,

Shelley

Inspiring
August 9, 2011

Shelley,

As you tried, the order should be:

Else, if context is: Section{first} < Chapter

Use paragraph format: Heading1NoNewPage

Else, if context is: Section < Chapter
Use paragraph format: Heading1

The more specific context precedes the less specific. In this case, the first also satisfies the second. So, if they were switched, the last one never would be seen.

But I think the problem is that there should be a space between Section and {first}, as in Section {first} < Chapter

Van