Skip to main content
4everJang
Legend
April 3, 2013
Answered

How do I set column widths in read/write rules?

  • April 3, 2013
  • 1 reply
  • 1446 views

Hello structure experts,

I am reading a set of DITA files into a specific FM template format, and there is one detail I cannot get to work properly. It should be possible to define column widths in a table, even if the DITA file does not include that information. But the Structure Application Developer Reference does not give the information on which string to pass to the column widths fm property. Does anyone out there have experience in doing this ?

Thanks

Jang

This topic has been closed for replies.
Correct answer 4everJang

Hi Russ,

there's nothing bad about a good plug. In this case, the customer does not own FrameSLT and the project will not require it for anything else, so I will have to solve it in the read-write rules (so that no additional scripting is required) or maybe do it from ExtendScript if all else fails. There is only one table with a specific framemaker element name that requires fixed settings for its columns. I am checking various options, might even be able to do this via the EDD.

Thanks

Jang


Got it !!!

Turned out to be simple, but the info was more or less hidden in the Dev Ref Guide: I had already put the "fm property column widths is value " line in but did not know the syntax for the values. Turns out you need to delimit the values by spaces, not commas. The parser does not give ANY useful information about this, just mentions 'syntax error near somewhere' or completely ignores the values you specify.

This is how the rule for my DITA properties element now works out:

element "properties" {

  is fm table element;

  fm property columns value is "3";

  fm property column widths value is "5cm 5cm 6cm";

  }

It works. I earn 10 points for answering my own question. :-)

Ciao

Jang

1 reply

Inspiring
April 3, 2013

Hello Jang,

this information in the r/w-rules should do the trick:

element "colspec"

{

  is fm colspec;

  attribute "colnum" is fm property column number;

  attribute "colname" is fm property column name;

  attribute "align" is fm property cell alignment type;

  attribute "charoff" is fm property cell alignment offset;

  attribute "char" is fm property cell alignment character;

  attribute "colwidth" is fm property column width;

  attribute "colsep" is fm property column ruling;

  attribute "rowsep" is fm property row ruling;

}

4everJang
4everJangAuthor
Legend
April 3, 2013

Hi Gorly,

Thanks for this info. I need to introduce the colspec in the reader rules, as there is none in the DITA file for this particular table type, but I think I will manage.

Ciao

Jang

Legend
April 3, 2013

Got it !!!

Turned out to be simple, but the info was more or less hidden in the Dev Ref Guide: I had already put the "fm property column widths is value " line in but did not know the syntax for the values. Turns out you need to delimit the values by spaces, not commas. The parser does not give ANY useful information about this, just mentions 'syntax error near somewhere' or completely ignores the values you specify.

This is how the rule for my DITA properties element now works out:

element "properties" {

  is fm table element;

  fm property columns value is "3";

  fm property column widths value is "5cm 5cm 6cm";

  }

It works. I earn 10 points for answering my own question. :-)

Ciao

Jang


Jang, thanks for the followup. I wasn't aware that this was even possible, but luckily I didn't have the confidence to assert it as fact.

Russ