• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Table style when importing XML

Community Beginner ,
Apr 10, 2024 Apr 10, 2024

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.

Cassiano359491465s95_0-1712758881869.png

Cassiano359491465s95_2-1712758881870.png

 

 

 

TOPICS
Structured

Views

452

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 2 Correct answers

Community Expert , Apr 10, 2024 Apr 10, 2024

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>
  
...

Votes

Translate

Translate
Community Expert , Apr 12, 2024 Apr 12, 2024

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.

Votes

Translate

Translate
Community Expert ,
Apr 10, 2024 Apr 10, 2024

Copy link to clipboard

Copied

Can you post the XML of that table? Thanks.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 10, 2024 Apr 10, 2024

Copy link to clipboard

Copied

Hey, here it is: 

Cassiano359491465s95_0-1712773721270.png

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 10, 2024 Apr 10, 2024

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 10, 2024 Apr 10, 2024

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";
}}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 10, 2024 Apr 10, 2024

Copy link to clipboard

Copied

Oh sorry, I paste twice. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 10, 2024 Apr 10, 2024

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:

image.png

 

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 10, 2024 Apr 10, 2024

Copy link to clipboard

Copied

Thank you very much! But how can I scale this table, which gets the frame's dimensions?

Cassiano359491465s95_0-1712779512542.png

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 10, 2024 Apr 10, 2024

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.?

-Matt Sullivan
FrameMaker Course Creator, Author, Trainer, Consultant

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 11, 2024 Apr 11, 2024

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?

Cassiano359491465s95_0-1712835950979.png

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 11, 2024 Apr 11, 2024

Copy link to clipboard

Copied

Set the width attribute value to a width property value in the read write rules. 

-Matt Sullivan
FrameMaker Course Creator, Author, Trainer, Consultant

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 11, 2024 Apr 11, 2024

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;
}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 11, 2024 Apr 11, 2024

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."

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 11, 2024 Apr 11, 2024

Copy link to clipboard

Copied

Thank you very much guys! 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 12, 2024 Apr 12, 2024

Copy link to clipboard

Copied

But I need to add this attribute in EDD too, right? 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 12, 2024 Apr 12, 2024

Copy link to clipboard

Copied

LATEST

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.

-Matt Sullivan
FrameMaker Course Creator, Author, Trainer, Consultant

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines