Copy link to clipboard
Copied
When I import the XML, the columns and rows are mixing in a single-column table, how do I solve this? I'm attaching how it should be and how it's looking.
I mocked this up here and this is what I came up with. Here is the XML:
<?xml version="1.0" encoding="UTF-8"?>
<Section>
<Title>ORDERING INFORMATION</Title>
<Table Table_ID="Ordering_info" cols="4">
<TableTitle>Ordering Information</TableTitle>
<TableHead>
<Row>
<Cell>Part Number</Cell>
<Cell>Package</Cell>
<Cell>Top Marking</Cell>
<Cell>MSL Rating</Cell>
</Row>
</TableHead>
...
No, the XML attribute is processed into an fm property when opened by fm. Then the fm property is processed into an attribute again when saving to XML.
Do you have the width value set in the XML?
If not, set a value for the property in the rule as well.
Copy link to clipboard
Copied
Can you post the XML of that table? Thanks.
Copy link to clipboard
Copied
Hey, here it is:
Copy link to clipboard
Copied
Thanks for the screenshot. It would be easier if you copied/pasted the XML into a post.
Your structured application should refer to a set of Read Write Rules that determine which elements get converted to certain table parts in FrameMaker. Do you have a Read Write Rules file referred to in your structured application?
Copy link to clipboard
Copied
I have this one, but I don't know how exactly to do it. Please tell me if this is wrong:
fm version is "15.0";
/*
* Include all ISO entity mapping rules.
*/
element "xref" {
is fm cross reference element "Xref";
attribute "formatprop" is fm property cross-reference format;
}
element "table" {
is fm table element "Table";
attribute "frame"
{
is fm property table border ruling;
value "top" is fm property value top;
value "bottom" is fm property value bottom;
value "topbot" is fm property value top and bottom;
value "all" is fm property value all;
value "sides" is fm property value sides;
value "none" is fm property value none;
}
attribute "colsep" is fm property column ruling;
attribute "rowsep" is fm property row ruling;
attribute "numcols" is fm property columns;
attribute "colwidths" is fm property column widths;
}
element "tablehead" {
is fm table heading element "TableHead";
}
element "tablebody" {
is fm table body element "TableBody";
}
element "row" {
is fm table row element "Row";
}
element "cell" {
is fm table cell element "Cell";
}
element "graphic" {
is fm graphic element "Graphic";
writer anchored frame {
notation is "CGM";
export to file "$(docname).cgm";
}}
fm version is "15.0";
/*
* Include all ISO entity mapping rules.
*/
element "xref" {
is fm cross reference element "Xref";
attribute "formatprop" is fm property cross-reference format;
}
element "table" {
is fm table element "Table";
attribute "frame"
{
is fm property table border ruling;
value "top" is fm property value top;
value "bottom" is fm property value bottom;
value "topbot" is fm property value top and bottom;
value "all" is fm property value all;
value "sides" is fm property value sides;
value "none" is fm property value none;
}
attribute "colsep" is fm property column ruling;
attribute "rowsep" is fm property row ruling;
attribute "numcols" is fm property columns;
attribute "colwidths" is fm property column widths;
}
element "tablehead" {
is fm table heading element "TableHead";
}
element "tablebody" {
is fm table body element "TableBody";
}
element "row" {
is fm table row element "Row";
}
element "cell" {
is fm table cell element "Cell";
}
element "graphic" {
is fm graphic element "Graphic";
writer anchored frame {
notation is "CGM";
export to file "$(docname).cgm";
}}
Copy link to clipboard
Copied
Oh sorry, I paste twice.
Copy link to clipboard
Copied
I mocked this up here and this is what I came up with. Here is the XML:
<?xml version="1.0" encoding="UTF-8"?>
<Section>
<Title>ORDERING INFORMATION</Title>
<Table Table_ID="Ordering_info" cols="4">
<TableTitle>Ordering Information</TableTitle>
<TableHead>
<Row>
<Cell>Part Number</Cell>
<Cell>Package</Cell>
<Cell>Top Marking</Cell>
<Cell>MSL Rating</Cell>
</Row>
</TableHead>
<TableBody>
<Row>
<Cell>12345</Cell>
<Cell>ABC</Cell>
<Cell>See Below</Cell>
<Cell>3</Cell>
</Row>
</TableBody>
</Table>
</Section>
Here are my Read/Write Rules:
fm version is "16.0";
writer use proportional widths;
element "Table" {
is fm table element;
attribute "cols" is fm property columns;
}
element "TableTitle" is fm table title element;
element "TableHead" is fm table heading element;
element "TableBody" is fm table body element;
element "Row" is fm table row element;
element "Cell" is fm table cell element;
Here is my output:
The keys is that you have to have an attribute that tells the parser how many columns your table has. In my example, I have cols="4" in my Table element.
Copy link to clipboard
Copied
Thank you very much! But how can I scale this table, which gets the frame's dimensions?
Copy link to clipboard
Copied
Tell us more about what the widths need to be.
Should they have fixed widths, be proportional to each other, or proportional to the frame, etc.?
Copy link to clipboard
Copied
Hi Matt, I want them to have the text frame size defined in the Master Pages, as in the screenshot below. But when I import the XML, the table size changes, and I wanted to automate that. Should I define something in the read/write rules or in the EDD? How can I do this?
Copy link to clipboard
Copied
Set the width attribute value to a width property value in the read write rules.
Copy link to clipboard
Copied
You have to set an attribute value on the table element that specifies the desired column widths. Here, I am using proportional widths, adding up to 100%:
<Table Table_ID="Ordering_info" cols="4" colwidths="40* 20* 20* 20*">
You need a Read/Write rule that tells FrameMaker which attribute to use for the column widths:
element "Table" {
is fm table element;
attribute "cols" is fm property columns;
attribute "colwidths" is fm property column widths;
}
Copy link to clipboard
Copied
All of this information is in the "Adobe FrameMaker Structured Application Developer’s Reference" and "Adobe FrameMaker Structured Application Developer’s Guide."
Copy link to clipboard
Copied
Thank you very much guys!
Copy link to clipboard
Copied
But I need to add this attribute in EDD too, right?
Copy link to clipboard
Copied
No, the XML attribute is processed into an fm property when opened by fm. Then the fm property is processed into an attribute again when saving to XML.
Do you have the width value set in the XML?
If not, set a value for the property in the rule as well.