Hi all,
We have a requirement for some custom table ruling, and, as we all know, this is not supported natively by structured Frame. We don't need to enforce it via the EDD, but just need to be able to apply it and have it persist in the XML somewhere.
So I read a useful post here (Re: Control table row or cell formatting via EDD context rules?) where Lynne P. provided info on table properties now supported in Frame 11 and 12, and we have tried to implement this.
We are working in Frame 11 using a modified Docbook XML DTD, and we work only in XML, i.e. we never same the documents as Frame binaries.
Here's what we did:
1. In our DTD, we added these attributes based on the list of custom ruling properties from the Frame 12 Dev Ref Guide:
use-bottom-rule-override CDATA #IMPLIED
bottom-rule-override CDATA #IMPLIED
use-top-rule-override CDATA #IMPLIED
top-rule-override CDATA #IMPLIED
use-left-rule-override CDATA #IMPLIED
left-rule-override CDATA #IMPLIED
use-right-rule-override CDATA #IMPLIED
right-rule-override CDATA #IMPLIED
2. In the EDD, we added these pairs of attributes on our <entry> element (representing a table cell):
UseBottomRulingOverride,
BottomRulingOverride
UseTopRulingOverride,
TopRulingOverride
UseLeftRulingOverride
LeftRulingOverride
UseRightRulingOverride
RightRulingOverride
All attributes are optional. Each of the "Use....Override" attributes have a possible value of "0" or "1" to act as a switch for true/false. Each of the other attributes have possible values based on Frame's style of the custom ruling as defined in the Table Designer, in this case, "None, Double, Medium, Thick, Thin, Very Thin".
3. In our rules, we added these attributes to the <entry> element, like so:
element "entry"
{
is fm table cell element "Entry";
attribute "UseBottomRulingOverride" is fm property use bottom ruling override;
attribute "BottomRulingOverride" is fm property bottom ruling override;
attribute "UseTopRulingOverride" is fm property use top ruling override;
attribute "TopRulingOverride" is fm property top ruling override;
attribute "UseLeftRulingOverride" is fm property use left ruling override;
attribute "LeftRulingOverride" is fm property left ruling override;
attribute "UseRightRulingOverride" is fm property use right ruling override;
attribute "RightRulingOverride" is fm property right ruling override;
}
We also mapped the Frame attributes above to the XML attributes in the DTD, i.e. for example:
attribute "use-bottom-rule-override" is fm attribute "UseBottomRulingOverride";
...<etc.>
Here's the result:
It seems that everything is "working", meaning that Frame is recognizing the attributes and is not throwing any parsing errors, however:
I create a new table, then:
1. In a cell (entry element), I set any of the "use...." true/false attributes to "1". Then I set the other one in the pair to some supported value, such as "Thick". No visual change occurs. I close the file, re-open it, and the values are still set, but no custom ruling occurs.
2. I set some custom rules using only the Custom Ruling and Shading dialog. I have the XML open in a text editor, so look at it and Frame has set the relevant values to the appropriate attributes, i.e. the "use..." are now "1" and the matching pair is whatever I choose, for instance, "Medium". When I save, close and reopen, some of the custom ruling is retained -- inside borders but never outside borders. Also, never the ruling between the heading row and a regular body row -- yet the attribute values are retained.
So, while Frame allows me to set the attributes explicitly and retains them in the XML, any custom ruling set via attributes and not the dialog is not retained.
Thoughts, anyone?
Thanks!
Shelley
Shelley Hoose
Sr Doc Developer, Rogue Wave Software