Thread View: adobe.framemaker.sgml
7 messages
7 total messages
Started by soundworkz
Mon, 12 Feb 2007 21:58
Columns Attribute for R/W rules
Author: soundworkz
Date: Mon, 12 Feb 2007 21:58
Date: Mon, 12 Feb 2007 21:58
18 lines
1366 bytes
1366 bytes
I am in need of a way for my f/m file to convert my tables in f/m into xml without the columns collapsing into a single file and without specifying the exact number of columns to be used in the R/W rules. I needthis flexibility as my tables have anywhere from 2- 14 columns. Does anybody know of a way to do this? My tables are defined as follows. I don't believe they are CALS tables as I have gone away from their naming conventions. Element (Table): Table General rule: TableTitle, THeading?, TBody, TFooting? Element (Table Title): TableTitle General rule: Element (Table Heading): THeading General rule: TRow+ Element (Table Body): TBody General rule: TRow+ Element (Table Footing): TFooting General rule: TRow+ Element (Table Row): TRow General rule: TCell+ Element (Table Cell): TCell General rule: ( | Figure )*
Re: Columns Attribute for R/W rules
Author: Martti_Poutanen
Date: Tue, 13 Feb 2007 07:37
Date: Tue, 13 Feb 2007 07:37
14 lines
1325 bytes
1325 bytes
Hi,
Your DTD must have an attribute for number of columns in the table element. Since you are not using CALS or OASIS table model, you need to build your own rw-rules for it.
Let's call this attribute "cols" and also assume that you use lowercase element names in the DTD. So your r/w rules should look like:
element "table" {
is fm table element "Table";
attribute "cols" is fm property columns;
}
If there is no reason not to use standard table model, you should use one. The benefit is that then yuou could use the available r/w and edd definitions.
BR, Martti
Re: Columns Attribute for R/W rules
Author: soundworkz
Date: Tue, 13 Feb 2007 07:45
Date: Tue, 13 Feb 2007 07:45
3 lines
1233 bytes
1233 bytes
If I stick with the CALS model, do I need to still define the number of columns. My whole point is that I may want to implement an "n" column table, where "n" can be any number from 1-15. Are you saying that adobe is going to make me manually enter 15 or however many table types, each one with a different number of columns for its attribute. I don't see how this problem could have never popped up before and how f/m could not have a better way of doing this than by brute force. Hank
Re: Columns Attribute for R/W rules
Author: Martti_Poutanen
Date: Tue, 13 Feb 2007 08:10
Date: Tue, 13 Feb 2007 08:10
9 lines
1297 bytes
1297 bytes
Hi Hank, You don't need to enter it manually. Frame just needs the number of columns while reading in XML (it either comes from XML or it could come from r/w rules when dealing with fixed-number-of-cols tables). The r/w rules will do the work for you, internally frame knows the number of columns while writing XML and r/w provides the mapping to XML for that value. During read, frame must know the number of columns while building the table from XML. Without it, everything collapses as you've seen. So, when things are properly defined, there is no manual intervention needed. Martti
Re: Columns Attribute for R/W rules
Author: soundworkz
Date: Tue, 13 Feb 2007 18:34
Date: Tue, 13 Feb 2007 18:34
6 lines
1971 bytes
1971 bytes
Hi Marti, What I mean is that is there a more intelligent way of defining tables than by specifying table1col, table2col, table3col, tabl4col, ... table20col in the EDD and then specifying in the R/W rules the column attribute for each one. I have to leave room for user flexibility in the future for whatever table structure might come up. Is my only resort to define 20 or so table types with varying column attributes in the r/w file? The intention is to make things as simple and small as possible. One potential problems is if I want to search tables in my database of xml and f/m files, do I then need to keep track of how many columns are in each table to be able to find a particular table in a search or even to find that table when I need a cross reference to it in a huge list of tables. My database may potentially contain hundreds of tables and keeping track of the column count to search for tables is not desirable. Further, the users of my f/m structure will not want to see all this clutter when they are building the document. It makes sense then to have only one table element instead of the 20 table types (table1col, table2col, table3col, ... table20col) in my EDD. I mean if I can perhaps define a table with 100 columns and just lop off empty columns in the conversion to xml that might be a possible alternative but I have no idea how to do it? Hank
Re: Columns Attribute for R/W rules
Author: Russ Ward
Date: Tue, 13 Feb 2007 21:24
Date: Tue, 13 Feb 2007 21:24
9 lines
1675 bytes
1675 bytes
Hank, I think Martti is trying to say the same thing I was earlier. If you are using FM as your authoring tool, and your read/write rules are set up properly, FM will automatically write this attribute for you when you export XML. In that way, you only need one table element. You won't need to explicitly declare the column number in the element name or r/w rules. When you import XML into FrameMaker, it will read the number of columns in the attribute (rather than from your read/write rules) and generate the table properly. If your XML was generated from some tool other than FrameMaker, you'll simply need to run it through a simple XSLT transform to add that attribute. If you are using FM 7.2, you can make this xform part of the structure application. Those r/w rules I sent you were intended to demonstrate the syntax. I use those rules to import/export tables with any number of columns. Russ
Re: Columns Attribute for R/W rules
Author: soundworkz
Date: Wed, 14 Feb 2007 22:13
Date: Wed, 14 Feb 2007 22:13
4 lines
869 bytes
869 bytes
Hi Russ, After much of scratching my head, I finally figured out what you were trying to say and I did manage to get these tables worked out. Thank you and Martti for your kindness. Hank
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads