Skip to main content
Rsfl
Inspiring
July 31, 2013
Question

How to specify the table style in context rules for paragraphs in tables

  • July 31, 2013
  • 1 reply
  • 770 views

Hi all,

I set up table formats for different types of notes and the roundtrip XML<->FM works so far. However, I have not been able to format the paragraphs within the tables using context rules.

When I insert a table of a certain type (e.g. table_warning), then FM writes this type into the outputclass of the table's tgroup element when saving as XML. So I thought for the paragraph elements in the table I could use a rule that specifies a context like this:

* < tgroup[outputclass = "table_warning"]

Yet FM does not recognize the outputclass type.How can I address the table type in context rules?

Edit: I have been able to succeed when I wrap the entire table into an additional note element and manually define the outputclass for the note. Then I can use a context like * < note[outputclass = "table_warning"]. But I would prefer to omit the extra note element and refer to the table type directly.

Robert

This topic has been closed for replies.

1 reply

Inspiring
July 31, 2013

Try this rule (you might want to change the subcontexts according to your needs):

entry < row < * < table [outputclass = “table_warning”]

cheers Alex

Rsfl
RsflAuthor
Inspiring
July 31, 2013

Hi Gorly, nope does not work. Actually that seems logical to me because the table style that I select when inserting a table is not saved as an attribute of the table element, but as the outputclass of the tgroup.

The problem seems to be the handling of the table style. FM does not show it in the attribute inspector, only when I save it the outputclass attribute is set accordingly in the XML file.

In the Developer guide I could not find a hint yet on how to format a paragraph in dependency of the table style.

Inspiring
July 31, 2013

I guess this is because we  defined the according table formats in the outputclass attribute of the table element via choices. Completely forgot about that, sorry

But this way it works nicely (at least for us).