What context rules should be employed here?

Explorer ,
Mar 08, 2019

Copy link to clipboard

Copied

This seems like something that should be obvious but either I'm looking at it backwards or I'm trying to do something impossible.

Our typical document follows the structure 'document > section > [arbitrary depth] > section > [content]'

Documents and sections have titles, and sections have an optional attribute 'break'; <section break="Y"> should generate a page break, while <section> should flow on. Because pagination properties are inherited by all descendants, our EDD sets the pagination rule for the title elements not for documents and sections. Like this, it's working fine.

Now let's complicate things by introducing an 'included' element which can contain low level content, or one or more sections, some of which may need a page break. If we don't need any representation of the inclusion envelope in the document view then formatting and pagination already defined is fine. But we want to indicate an inclusion by putting a prefix and suffix on the 'include' element, so that the source of the included content is notated.

In our EDD we have (abbreviating a bit)

Element (container): included

Attribute list

1. name: srcfile string required

Prefix rules

1. In all contexts

     Prefix: Included: <$attribute[srcfile]>

Suffix rules

1. In all contexts

    Suffix: End inclusion: <$attribute[srcfile]>

This inserts the prefix but unfortunately the prefix is separated from the section title by the page break generated with the title.

If we want the prefix after a page break, and on the same page as the title, we need to put a pagination rule on the included element, but only if its first child is a section with [break=Y]. However there doesn't seem to be any way of specifying that in a context rule for 'included'. Also if the parent included element has generated a page break, we need to suppress pagination for the first child and for the first child's title. Not sure how to express that in a context rule either.

These things would be easy in XPath/XSL, but they don't seem easy in Frame. Can anyone give me some pointers here?

TOPICS
Structured

Views

253

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Have something to add?

Join the conversation